Skip to content

fix: bypass cache for locking document reads - #885

Closed
abnegate wants to merge 20 commits into
mainfrom
codex/for-update-bypass-cache
Closed

abnegate wants to merge 20 commits into
mainfrom
codex/for-update-bypass-cache

Conversation

@abnegate

@abnegate abnegate commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

  • bypass document cache reads when getDocument() is called with forUpdate=true
  • avoid saving forUpdate read results back into the normal document cache
  • add a regression test that proves stale cached data is ignored for locking reads

Tests

  • php vendor/bin/phpunit tests/unit/ForUpdateCacheTest.php
  • composer check
  • composer lint
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Locking reads bypass cache to avoid repopulating stale/partial entries.
    • Update handling refined: timestamp-only/numeric-drift no-ops won’t trigger storage writes; metadata-only changes require update permission. Read-only callers may be downgraded to silent no-ops (no storage write or update event) when stale-cache tolerance applies.
    • Nulling both created/updated timestamps is a no-op (timestamps preserved).
  • Tests

    • Added unit and e2e tests covering cache bypass, no-op/timestamp behavior, float equality, and authorization edge cases.

Loading
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.

2 participants