Repository navigation
fix(#661,#618,#589,#670,#634): remote page removal decides every page it removes - #67
Merged
Merged
Conversation
…ote page removal decides every page it removes Remote mode only; native mode keeps upstream behaviour. - Trash (docmost#661, docmost#634): RemoteTrashService runs both trash routes. It locks the subtree FOR NO KEY UPDATE, decides page#edit on every live page for the human and the delegated service account, and trashes exactly that set (seam docmost#172 pageIds). A deny is settled once outside the transaction before it refuses. Codes: 403 trash_needs_edit, 409 trash_subtree_changed, 503 trash_unconfirmed. - Purge (docmost#618, docmost#589): space#administer on every space of the subtree; the spaces are locked FOR SHARE and an archived one refuses with 409 space_archived. - Retention (docmost#589): seam docmost#183 swaps in RemoteTrashRetentionService. It purges only fully-trashed, fully-expired subtrees outside archived spaces, under locks; unarchive restarts the clock; it never purges a live child. - g1 guard: ccc_page_archived_space_move refuses a move out of an archived space. - Delegated leg (docmost#670): x-ccc-acting-service is parsed strictly and only ADDS checks (the human first), under the same locks and fence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…'s answer count and seam 172's side effects Review round 1 on cccvu/wiki-v2 PR 707: - RemoteTrashService runs each attempt in an OpSemaphore slot (TRASH_MAX_CONCURRENT=2, 2 s wait, then 503 engine_busy). An attempt holds a pooled connection, row locks and an xid across its PDP calls, so an uncapped trash could drain the pool under a slow PDP. The settle between attempts holds no slot. The docstring no longer claims one round trip. - page-delete-decision.spec.ts: decideAll refuses short, long and empty answers, in every chunk; null is unavailable; an empty set asks nothing. - remote-trash.pg.spec.ts: seam 172 revokes the share links of exactly the trashed rows and emits one page.soft_deleted with them; a refused trash does neither. Mutation-proven: no slot / slot held across the settle; no length check; no share delete, empty affected set, no emit: each reds its test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
TL;DR
Remote-mode page removal now decides every page it removes. A trash needs
page#editon every page it trashes. A purge needs space admin on every space it touches and never runs in an archived space. Retention never purges archived, live or unexpired pages. A delegated service account is decided under the same locks.Paired with super PR cccvu/wiki-v2#707, which carries the platform side, ADR 0033 and the seam records. Review them together.
Implementation plan, progress and tradeoffs (canonical, on the super repo): https://github.com/cccvu/wiki-v2/issues/661#issuecomment-6650012688
Related issues
cccvu/wiki-v2 issues 661, 618, 589, 670, 634 (closed by super PR 707)
What changed (
apps/server/src/, remote mode only)RemoteTrashService(new) runs both trash routes (the native/pages/delete, throughRemotePurgeInterceptor, andconditional-delete).FOR NO KEY UPDATEand decidespage#editfor the human, then the service account, on every live page.removePage(…, { pageIds }), never a re-walk.403 trash_needs_edit,409 trash_subtree_changed,503 trash_unconfirmed.RemotePurgeService:space#administeron every space of the subtree (Paste multiple images processing bug docmost/docmost#618). The spaces are lockedFOR SHARE, and an archived one refuses with409 space_archived([Feature Request] PWA (Progressive web app) support docmost/docmost#589). With the header, it decides the service leg too ([Feature Request]: Custom Emojis docmost/docmost#670).RemoteTrashRetentionService(new, seam §183core/page/page.module.ts): purges only fully-trashed, fully-expired subtrees outside archived spaces, under locks. Unarchive restarts the clock, and it never cascades into a live child.ccc_page_archived_space_moverefuses a move out of an archived space.x-ccc-acting-service: a strict parse; it only ADDS checks, the human is decided first, and it never reaches audit or logs.page-subtree.ts,page-delete-decision.ts,page-delete-errors.ts,acting-service.ts.How this was tested
tsc --noEmit: clean.src/authz src/service-bridge src/editor-compat src/common/helpers/prosemirror src/core/page): 173 suites pass. The only 2 red suites are the pre-existing lib0 ESM load failures incore/page, which are red on base and not in the CI lane.--runInBand 'src/(service-bridge|authz)/.*\.pg\.spec\.ts$',AUTHZ_REQUIRE_PG=1): 35/35 suites, 517/517 tests. Covered:pageIdsseam, the retention live-row skip, the g1 clause, andFOR UPDATEversusFOR NO KEY UPDATEon trash. Each went red.🤖 Generated with Claude Code