fix(knowledge): revoke absent documents without rewriting unchanged ACLs - #8179
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was successfully deployed
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
acl500 documents per statement. Everyaclassignment fires the projection trigger, which rewrites each filled chunk row of the document, so one batch of chunk-heavy documents could outrun the statement timeout, fail the run, and fail the same way on every retryrevokeDocumentAclsinsync-persistence.ts, used by both paths, follows the same approach aspersistDocumentAcls:aclis assigned only wherecardinality(acl) > 0,ACL_CHANGE_BATCH_SIZE(25) documents per statementaclRequirements/aclVerifiedAtcleared,ACL_WRITE_BATCH_SIZEper statement, without assigningacl, so it fires no fan-out[],[],null), revocation still runs ahead of and independently of the delete cap and suspect-listing guard, one lease-checked transaction per loaded page, soft/hard delete ordering, anddocsDeletedType of Change
Testing
sync-content-pass.postgres.test.tsagainst the real projection trigger, with a test-only AFTER UPDATE trigger counting fan-out: an absent document with an empty ACL fires nothing while an absent granted one is revoked and its filled projection rows become empty (unfilled rows stay NULL); a 60-document absent backlog is fully revoked with every removal reported; an already-empty ACL with leftover evidence gets it cleared without fan-out. Added to the "Verify Confluence audience migrations and permission queries in PostgreSQL" CI stepcardinality > 0guard, the 25 batch size, the evidence-only statement, itsnot(grants)guard, or reverting either call site each turns the matching tests redlib/knowledge/connectorssuites: 788 passed (with the Postgres tests running locally);bun run lint,bun run check:audits(47/47),apps/simtype-check passChecklist