fix: warm ACL cache on live _changes miss (v1.7.0) - #18
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a race where continuous / live
_changesfiltering 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 parentrec-*could stay invisible until a fresh sync.On ACL cache miss during
_changesfiltering (and_all_docs/ views /_findresponse filtering):ensureDocRows/cache.ensureDocsresolveDocAcl(row + parent +dbacl)AclUnavailableError_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
filterChangesStreamnow takesAclCachecanReadEnsured_changesmay await ACL warm)Tests
_localskipped by ensureDocRowsdbacl._ropens continuous feed before guest create; must seerec-*(+ child + rapid creates) on the live feed; stranger guest still isolatedTest plan
pnpm lint/pnpm typecheck/pnpm testpnpm test:integration(docker stack) — 157 passed