Skip to content

Serialize comment storage and schedule retention - #1

Merged
bago merged 3 commits into
mainfrom
codex/storage-concurrency-retention
Oct 9, 2026
Merged

bago merged 3 commits into
mainfrom
codex/storage-concurrency-retention

Conversation

@bago

@bago bago commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Concurrent moderation and retention can overwrite edits or recreate deleted pending records. Rewriting rate-limit JSON in place can also erase counters after an interrupted write.

This change serializes complete storage transactions with stable locks and replaces JSON only after a complete, flushed write to a unique temporary file. Empty or damaged rate-limit files fail closed. Publishing the approved record is the approval commit point: retries preserve subsequent edits, and retention removes hidden pending residues without changing the approved record. The daily Grav scheduler job applies the existing 7-day technical-data and 90-day pending-comment policy; pruning supports a dry-run preview.

Validation:

  • 49 existing isolated checks and 14 storage checks, including 20 PHP worker processes, injected short/failed writes, concurrent edits, approval recovery, deletion and retention preview.
  • The hidden-residue regression failed before the final fix and passes after it.
  • PHP syntax checks, strict Composer validation and Git whitespace checks pass locally on PHP 8.5.4. CI checks PHP 8.3 and 8.4.
  • Reviewed the changes against current main; no merge conflicts. The form/CAPTCHA, notification and API authorization implementations are unchanged by this PR.

The version remains 0.4.3-dev until a release is prepared. Deployment requires filesystem support for flock and atomic rename, and the host must invoke the Grav scheduler. No site records or private configuration are included. This PR does not merge or publish a release automatically.

@bago
bago marked this pull request as ready for review October 9, 2026 12:37
@bago
bago merged commit e28315f into main Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant