Repository navigation
fix: atomically replace cookie credentials - #87
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 8:22 AM ET / 12:22 UTC (Revision 2). ClawSweeper reviewWhat this changesReplace cookie credentials atomically with private permissions and consolidate file replacement for cookies, configuration, and OAuth tokens. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and v0.13.0. No actionable introduced defect was found; the focused regression coverage and preserved storage contracts support normal merge review. Priority: P2 Review scores
Verification
How this fits togetherspogo stores imported Spotify cookies, configuration, and OAuth tokens locally for later CLI commands. The shared writer commits complete files while callers retain responsibility for serialization, paths, and locking. flowchart TD
A[Cookie import or paste] --> D[Shared private file writer]
B[Configuration updates] --> D
C[OAuth token saves] --> D
D --> E[Write and sync temporary file]
E --> F[Atomic replacement]
F --> G[Complete file for later readers]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Use one private atomic writer while preserving existing serializers, config and OAuth locks, and cookie symlink behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: rewriting an existing 0644 cookie file retains its permissions, and an already-open reader shares the inode being overwritten. The new regression tests target both cases; this review did not execute them. Is this the best way to solve the issue? Yes. Reusing the existing temporary-file replacement approach repairs cookie writes and removes duplication without changing stored formats or caller locking. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against e532324d5e82. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
59b9367 to
38738b7
Compare
Cookie import and paste overwrote the existing file in place. An older file with mode 0644 retained those broad permissions after new credentials were written, and concurrent readers could see a truncated or partial JSON cookie jar.
Commit cookies through a synced, owner-only temporary file and atomic replacement. Share that writer with config and OAuth persistence, removing duplicated implementations while retaining bounded Windows reader retries, OAuth write-through replacement, and config locking. Cookie output symlinks keep their existing behavior. Newly created cookie directories use mode 0700.
Regression tests demonstrate both failures on the old implementation and cover fixed permissions, reader snapshots, symlink targets, complete replacements, cleanup after failures, and Windows readers. Documentation describes the storage guarantees. The shared implementation removes duplicated production code.
Validation: full Crabbox Linux race/coverage gate passed at 90.9%, lint reported zero issues, and dead-code, docs, and CLI build checks passed. A built-binary synthetic workflow verified
auth pastechanges an existing 0644 cookie file to 0600, preserves a custom symlink while replacing its target, and leavesauth statusworking. Independent review found no actionable P0–P2 defects; CI supplies the macOS, Windows, and Go-floor matrix.