Tombstone replay edge removals#588
Open
TZZheng wants to merge 1 commit into
Open
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.
Fixes #564.
Summary
v:2v:0replay chunks when JSONL history cannot fully reconstruct that hour, while rewriting tov:2when JSONL coverage is completeWhy
Replay deltas already tombstone removed nodes with
State: "__REMOVED__", and the frontend deletes those nodes during reconstruction. Edge deltas did not have an equivalent removal path: backend deltas only added/changed avatar/contact/mail edges, and the frontend only upserted edge arrays.That meant a removed edge could persist in reconstructed replay frames until the next keyframe, up to the keyframe interval, and could temporarily dangle toward nodes that had already been tombstoned.
Behavior
FrameDeltanow hasavatar_edges_removed,contact_edges_removed, andmail_removedtuple lists.computeDeltaemits deterministic removed-edge tuples by comparing previous edge keys against current edge keys.reconstructFramesdeletes removed edges using the same composite keys as the existing upsert paths, then applies add/change deltas.ReplayChunknow carries cache format versionv:2.Legacy cache handling
The cache migration is intentionally compatibility-preserving:
v:2chunks are served directly;v:2;This preserves old replay history after topology JSONL compaction/truncation, while ensuring newly generated chunks use the removal-capable wire format.
Non-goals
Validation
Parent and reviewer validation included:
git diff --check canonical/main...HEADcd portal && go test ./internal/api/... -count=1cd portal/web && npm ci && npm run buildcd portal && go build ./...cd portal && go vet ./...cd portal && go test ./... -count=1Focused tests cover:
v:0cache rewrite when JSONL coverage is completev:0compatibility serving when JSONL has no framesv:0compatibility serving when JSONL coverage is partialnpm cireported existing audit advisories during local validation; dependency remediation is outside this issue.Review
This went through the requested multi-review workflow:
The only review feedback was optional robustness cleanup for future consideration; no reviewer requested a blocking code change.