Skip to content

fix: warm ACL cache on live _changes miss (v1.7.0) - #18

Merged
cursor[bot] merged 2 commits into
mainfrom
feat/changes-acl-cache-warm-2989
Jul 26, 2026
Merged

fix: warm ACL cache on live _changes miss (v1.7.0)#18
cursor[bot] merged 2 commits into
mainfrom
feat/changes-acl-cache-warm-2989

Conversation

@PeterBaker0

@PeterBaker0 PeterBaker0 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a race where continuous / live _changes filtering denied readable documents solely because the ACL row was not yet in the in-memory cache (missing-row-create-path). Continuous feeds never redeliver that seq, so the parent rec-* could stay invisible until a fresh sync.

On ACL cache miss during _changes filtering (and _all_docs / views / _find response filtering):

  1. Warm via ensureDocRows / cache.ensureDocs
  2. Authorize with normal resolveDocAcl (row + parent + dbacl)
  3. Deny only after a successful warm shows the principal cannot read
  4. Fail closed on ensure/view/AclUnavailableError
  5. Skip _local/* ids in ensure (they are not ACL-mapped; warming them via keyed _all_docs + view reconcile incorrectly 503'd _local_docs)

Guest isolation and create-path / not-found semantics are unchanged.

API / version

  • filterChangesStream now takes AclCache
  • Added canReadEnsured
  • Version 1.7.0 (CHANGELOG + README note that live _changes may await ACL warm)

Tests

  • Unit: miss→warm→allow (normal / continuous / eventsource), miss→warm→deny, ensure throws fail-closed, batching, no ensure when already cached, _local skipped by ensureDocRows
  • Integration: contributor with dbacl._r opens continuous feed before guest create; must see rec-* (+ child + rapid creates) on the live feed; stranger guest still isolated

Test plan

  • pnpm lint / pnpm typecheck / pnpm test
  • pnpm test:integration (docker stack) — 157 passed
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 26, 2026 00:45
Continuous/_changes filtering no longer drops readable docs solely because
the in-memory ACL row was cold. Misses call ensureDocRows, then authorize;
true denials and fail-closed behavior remain after ensure. Bump to 1.7.0.

Co-authored-by: Peter Baker <PeterBaker0@users.noreply.github.com>
Keyed _all_docs can report _local docs as live while the ACL view omits
them, which marked the DB unavailable (503) on _local_docs listings.

Co-authored-by: Peter Baker <PeterBaker0@users.noreply.github.com>
@cursor
cursor Bot merged commit 04a5e15 into main Jul 26, 2026
1 check 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.

2 participants