fix: support exact snapshot updates - #176
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 9:54 PM ET / August 17, 2026, 01:54 UTC. ClawSweeper reviewWhat this changesThis PR adds a persisted Merge readinessKeep open for normal collaborator PR review. The opt-in exact mode preserves the established merge default, is wired through subscription, manual update, read-command refresh, and hybrid sync, and has focused regression coverage. Priority: P2 Review scores
Verification
How this fits togetherDiscrawl imports Git-hosted archive snapshots into a local SQLite cache. Subscription, manual update, automatic refresh, and hybrid sync select merge or exact reconciliation before search and sync commands use that cache. flowchart LR
A[Git snapshot] --> B[Subscribe update or sync]
C[Saved update mode] --> D[Choose merge or exact]
B --> D
D --> E[Local SQLite archive]
E --> F[Search and sync commands]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Land the explicit opt-in exact mode while retaining merge as the default for existing and richer local archives. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds an explicit operating mode rather than reporting a currently reproducible defect. Is this the best way to solve the issue? Yes. A persisted, opt-in exact mode solves dedicated-reader reconciliation without changing the documented merge default for existing archives. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against b560fd127b34. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What
Add a persistent exact snapshot update mode for dedicated readers of privacy-filtered shares.
The existing monotonic merge behavior correctly preserves richer local rows. However, a dedicated reader could retain channels and messages after a newer privacy-filtered snapshot omitted them because their permissions had become private.
Why
PR #118 intentionally introduced merge-by-default so snapshot updates would not delete rows learned from live Discord or the desktop cache. The existing
--forceflag was deliberately a one-shot exact replacement, and there was no persistent contract for readers that should mirror every new snapshot exactly.Fix
share.update_mode = "merge" | "exact", defaulting tomerge.subscribe --exactto persist exact mode for dedicated snapshot readers.sync --update=autohonor the configured mode.--forceas a one-shot exact replacement without changing the persisted mode.public_only; filtering and reader reconciliation remain separate choices.Proof
GOWORK=off go test ./...make fmtmake lintgit diff --checkNo release was performed.