Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR rewrites the NostrApiExamples class to execute all event types in a sequential manner instead of using a multi-threaded executor approach. The changes simplify the code structure while enabling comprehensive testing of all nostr-java API functionality including metadata, notes, direct messages, mentions, deletions, ephemeral events, reactions, and NIP28 channel operations.
Key changes:
- Removed Spring Boot dependency and multi-threaded execution
- Converted from ApplicationRunner to standalone main class with sequential execution
- Uncommented and enabled all previously disabled event type examples
Comments suppressed due to low confidence (1)
nostr-java-examples/src/main/java/nostr/examples/NostrApiExamples.java:114
- The unused variable
tagswas removed but the deletion event creation logic may be incomplete. Verify that the deletion event properly references the original event without explicit tag creation.
var event = sendTextNoteEvent();
| var reactionEvent = nip25.createReactionEvent(event.getEvent(), Reaction.LIKE, new Relay("localhost:5555")); | ||
| reactionEvent.signAndSend(RELAYS); | ||
| nip25.createReactionEvent(event.getEvent(), "💩", new Relay("localhost:5555")).signAndSend(); | ||
| nip25.createReactionEvent(event.getEvent(), "\uD83D\uDCA9", new Relay("localhost:5555")).signAndSend(); |
There was a problem hiding this comment.
[nitpick] The Unicode escape sequence \uD83D\uDCA9 for the emoji is less readable than the original emoji character. Consider using the actual emoji character for better code readability.
| nip25.createReactionEvent(event.getEvent(), "\uD83D\uDCA9", new Relay("localhost:5555")).signAndSend(); | |
| nip25.createReactionEvent(event.getEvent(), "💩", new Relay("localhost:5555")).signAndSend(); |
| } | ||
|
|
||
| public static void filters() throws InterruptedException { | ||
| private static void filters() throws InterruptedException { |
There was a problem hiding this comment.
The filters() method visibility was changed from public to private, which may break external usage if this method was intended to be part of the public API for examples.
| private static void filters() throws InterruptedException { | |
| public static void filters() throws InterruptedException { |
| '\n' + '\n' + "################################ ACCOUNTS END ################################"; | ||
|
|
||
| log.info(msg); | ||
| System.out.println(msg); |
There was a problem hiding this comment.
[nitpick] Replacing structured logging (log.info) with System.out.println reduces the ability to control log levels and formatting. Consider using a simple logger or at least System.err for error cases.
Summary
Testing
mvn -q verify(fails: Docker environment not available)https://chatgpt.com/codex/tasks/task_b_688abcf76dd48331b054ab3e55497eed