Skip to content

Conversation

@tcheeric
Copy link
Owner

@tcheeric tcheeric commented Oct 6, 2025

Summary

Related issue: #____

What changed?

  • Renamed the cached serialization buffer in GenericEvent and refreshed supporting helpers so signing and dispatch use the clearer serializedEventCache accessors.
  • Introduced EventJsonMapper to own the shared Jackson configuration and swapped previous IEvent constants and call sites to the new utility for cleaner dependencies.
  • Replaced the double-checked locking singleton in NostrSpringWebSocketClient with an initialization-on-demand holder to remove volatile state while keeping lazy initialization semantics.

BREAKING

None.

Review focus

  • Verify the new EventJsonMapper wiring covers all former IEvent.MAPPER_BLACKBIRD usages without leaving stray imports.
  • Confirm the singleton holder in NostrSpringWebSocketClient still satisfies existing entry points.

Checklist

  • Scope ≤ 300 lines (or split/stack)
  • Title is verb + object (e.g., “Refactor auth middleware to async”)
  • Description links the issue and answers “why now?”
  • BREAKING flagged if needed
  • Tests/docs updated (if relevant)

Testing

  • mvn -q verify (fails: xyz.tcheeric:nostr-java-bom:1.1.1 missing from Maven Central)

Network Access


https://chatgpt.com/codex/tasks/task_b_68e337e2acfc83319e62250f0db94bc8

@chatgpt-codex-connector
Copy link

💡 Codex Review

public NostrSpringWebSocketClient() {
this(null, new DefaultNoteService());
}
/**
* Construct a client with a single relay configured.
*/
public NostrSpringWebSocketClient(String relayName, String relayUri) {
this();
setRelays(Map.of(relayName, relayUri));
}
/**
* Construct a client with a custom note service implementation.
*/
public NostrSpringWebSocketClient(@NonNull NoteService noteService) {
this(null, noteService);
}
/**
* Construct a client with a sender identity and a custom note service.
*/
public NostrSpringWebSocketClient(@NonNull Identity sender, @NonNull NoteService noteService) {
this.sender = sender;

P0 Badge Null-enforced core constructor breaks all default instantiation

The new constructor chain marks sender as @NonNull but both the zero‑argument and note‑service constructors delegate by passing null. Lombok injects a null check for annotated parameters, so new NostrSpringWebSocketClient() (including the singleton holder) and new NostrSpringWebSocketClient(noteService) now throw NullPointerException before initialization, making the client unusable. Either remove the @NonNull requirement for the optional sender or ensure a non‑null identity is supplied when delegating.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@codecov-commenter
Copy link

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@tcheeric
Copy link
Owner Author

tcheeric commented Oct 6, 2025

💡 Codex Review

public NostrSpringWebSocketClient() {
this(null, new DefaultNoteService());
}
/**
* Construct a client with a single relay configured.
*/
public NostrSpringWebSocketClient(String relayName, String relayUri) {
this();
setRelays(Map.of(relayName, relayUri));
}
/**
* Construct a client with a custom note service implementation.
*/
public NostrSpringWebSocketClient(@NonNull NoteService noteService) {
this(null, noteService);
}
/**
* Construct a client with a sender identity and a custom note service.
*/
public NostrSpringWebSocketClient(@NonNull Identity sender, @NonNull NoteService noteService) {
this.sender = sender;

P0 Badge Null-enforced core constructor breaks all default instantiation

The new constructor chain marks sender as @NonNull but both the zero‑argument and note‑service constructors delegate by passing null. Lombok injects a null check for annotated parameters, so new NostrSpringWebSocketClient() (including the singleton holder) and new NostrSpringWebSocketClient(noteService) now throw NullPointerException before initialization, making the client unusable. Either remove the @NonNull requirement for the optional sender or ensure a non‑null identity is supplied when delegating.
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

* Open a pull request for review

* Mark a draft as ready

* Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

* @codex fix this CI failure

* @codex address that feedback

@codex address this ci error

@tcheeric tcheeric merged commit 6c89350 into develop Oct 6, 2025
2 checks passed
@chatgpt-codex-connector
Copy link

Summary

Testing

  • mvn -q verify (fails because xyz.tcheeric:nostr-java-bom:1.1.1 is unavailable from Maven Central)

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants