fix(sync): discover newly archived threads - #183
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 19, 2026, 1:41 PM ET / 17:41 UTC. ClawSweeper reviewWhat this changesThe PR updates Discrawl’s routine Discord sync to discover newly archived threads, track per-parent archive cursors, and fully index new thread histories. Merge readiness⛔ Blocked by patch quality or review findings - 4 items remain Keep open: the live backup evidence supports the new discovery path, but the prior P1 finding remains on the unchanged head—archive cursors advance before the newly discovered threads are durably synchronized, so a later failure can permanently skip their messages. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherDiscrawl builds a Discord channel catalog before storing channel records and synchronizing message histories into its local archive. The new archived-thread scan feeds that catalog, so its cursor determines which archived threads later syncs can still discover. flowchart LR
A[Discord archived-thread API] --> B[Incremental catalog scan]
B --> C[New thread catalog]
C --> D[Store channels and sync histories]
D --> E{Guild sync succeeds?}
E -->|yes| F[Persist archive cursor]
E -->|no| G[Retry from prior cursor]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Persist each archive cursor only after the corresponding guild’s catalog storage and message synchronization succeed, with a failure-then-retry regression test proving the archived thread is rediscovered. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: let archive discovery succeed, then fail channel storage, member refresh, or message synchronization; the persisted cursor prevents the next latest-only run from rediscovering that thread. Is this the best way to solve the issue? No; the discovery approach is sound, but committing its cursor before downstream durable work completes is not a safe retry boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against 5a0dc6f611f8. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Landed via squash onto main.
|
Summary
Root cause
Steady-state catalog sync called only Discord's guild-active-threads endpoint. A thread created and archived between runs disappeared from that endpoint before Discrawl learned its channel ID, so its messages were never indexed.
Tests
TestSyncLatestOnlyDiscoversAndCompletesNewArchivedThreadfailed withexpected 1 thread, actual 0GOWORK=off go test ./...make lintmake fmtLive proof
Branch-scoped
publish-discord-backuprun 32280457716 passed at exact head654f930cb8215bc1064e44ea5eee1f09bf8198e9.history_completedc5fd83ad0977f3b3735304b1451d0633bd002e8