fix: restore sender overrides in NIP-01 builder#485
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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
| public GenericEvent buildReplaceableEvent(Integer kind, String content) { | ||
| return new GenericEventFactory(resolveSender(null), kind, content).create(); | ||
| return buildReplaceableEvent(null, kind, content); | ||
| } |
There was a problem hiding this comment.
Disambiguate overloads when delegating
The new helper buildReplaceableEvent(Integer kind, String content) delegates to buildReplaceableEvent(null, kind, content) while two overloads with the same arity now exist (Identity, Integer, String and List<BaseTag>, Integer, String). Because null matches both first-parameter types, this call will not compile (“reference to buildReplaceableEvent is ambiguous”). The same ambiguity exists for buildEphemeralEvent(Integer, String) and buildAddressableEvent(Integer, String) which delegate in the same way. These delegations should cast the null to the intended parameter type or call the implementation directly to keep the API compiling.
Useful? React with 👍 / 👎.
Summary
Related issue: #____
Restored the ability for
NIP01EventBuilderto accept per-call senders so the builder can satisfy callers that need to override the default identity, addressing the review feedback.What changed?
NIP01EventBuildercovering override and fallback behavior.Testing
BREAKING
None.
Review focus
Please double-check that the overload placement and generics preserve backward compatibility and align with desired API surface.
Checklist
Network Access
No blocked domains encountered during this work.
https://chatgpt.com/codex/tasks/task_b_68ed9352511883319e4b975b168abe18