-
Notifications
You must be signed in to change notification settings - Fork 268
feat(core): relay self-supersede on stale base + db_version provenance #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an accepted write advances
db_versionwithout changing the markdown (for example a relay retry/no-op save with the samedb_checksum), an older materialized object still has the samebm-file-checksum, so this checksum-only trust check treats the object's stalebm-db-versionas current and publishes it to live-update consumers. Since the cloud relay is expected to usedb_versionarithmetic for echo-vs-out-of-band decisions, please compare the metadata version with the currentNoteContent.db_version(or omit it unless that version is verified), not just with the content checksum.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scenario is real, but the staleness has one direction that fails safe: an object's metadata version is the version of the write that produced that object, so it can LAG the accepted row (content-identical accept bumps db_version without a new materialization) but can never exceed it. A lagging version rides identical content, so the consumer's version arithmetic reads it as an echo and skips - exactly the right outcome for identical bytes. The cloud reconciler additionally treats event fields as a pre-filter only: any apply path goes through the authoritative /read, whose response carries the DB row's current db_version and is the decision-grade value.
Threading NoteContent.db_version verification into the index/materialized-source contracts would add a tenant-DB read to a path that deliberately works from object state alone, to guard a direction that cannot mislead. Encoded the hint-vs-ground-truth contract in the code comment at the plan site instead (4993e71). Happy to revisit if a consumer ever wants to treat event versions as authoritative - that would be the contract change to block.