Finalize local message hashes and accept SHA-256 API references - #45
Open
markmnl wants to merge 4 commits into
Open
Finalize local message hashes and accept SHA-256 API references#45markmnl wants to merge 4 commits into
markmnl wants to merge 4 commits into
Conversation
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.
Local-only sends and reactions now acquire their protocol SHA-256 atomically with
time_sent. Message mutations share a transaction and row lock, stage file writes, and return success only after commit. The shared finalizer retains the wire representation for subsequent federation and independently finalizes add-to batches.Expose
sha256/psha256in message, list, WebSocket and structured thread responses, preservingmessage_sha256as an alias. Message routes accept a numeric ID or SHA-256; requestpidalso accepts an original or batch hash while responsepidremains numeric. Batch hashes are preserved as the actual wire parent, with participation checks for that branch. Numeric ID routes and numeric response fields remain available; batch-only participants must use their batch hash when composing replies.Depends on markmnl/fmsgd#44 (the module pins its feature commit) and implements markmnl/fmsg#37. Upgrade the daemon/API/schema together with writers paused, then backfill existing local-only messages before resuming. The README documents the sequence. Docker integration: markmnl/fmsg-docker#21.
Validation:
go build ./..., all Go tests, PostgreSQL integration tests (including concurrent sends/edits, rollback, commit rejection, hash authorization, batch replies and WebSocket payloads), race checks and vet passed. The coordinated Docker suite passed all 15 tests with challenges forced on, including local-only delivery followed by federation, compressed batches and notification-only code 11.