Conversation
update() restamped created_at with the clock before computing the id, so callers that set created_at got an id for a different second, and NIP-59 randomised timestamps were replaced by the send time. NIP-01 derives the id from the event's own fields, so update() now only stamps the clock when created_at is unset (null or zero). Restamping on purpose is available through the new updateWithCurrentTime(). Fixes #559
- nostr-java (all modules): 2.4.1 → 2.4.2 (patch) [maven] Fixed: GenericEvent.update() overwrote a caller-set created_at, so ids could be computed for a different second (#559). Added: GenericEvent.updateWithCurrentTime(), and the Lyrebird mention in the MCP server how-to.
fix(event): keep a preset created_at in GenericEvent.update() (2.4.2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release 2.4.2: promotes
developtomain.Closes #559
Type of change
fix- Bug fix (non-breaking)docs- Documentation onlychore- Build, CI, or tooling changesWhat changed?
Everything from #560:
GenericEvent.update()keeps acreated_atthat is already set and only stamps the clock when it is unset (null or 0), so the id always matches the event's owncreated_at(NIP-01). NewupdateWithCurrentTime()for deliberate restamping.Testing
mvn -q clean install -DskipITs, and CIbuild (17)/build (21)green on fix(event): keep a preset created_at in GenericEvent.update() (2.4.2) #560.NostrMcpServerStdioIT.aHostCanSeeWhichIdentitiesTheServerHolds), also failing before this change. See fix(event): keep a preset created_at in GenericEvent.update() (2.4.2) #560.Checklist