Repository navigation
test: yjs suites and bench scenarios fit raak's attachment policy, placement and task edits - #168
Merged
Merged
Conversation
…acement and task edits Two yjs integration tests assumed that an organization member may update their own attachment, which raak's policy denies. `assumeMemberAttachmentPolicy` moves to `shared/testing/member-policy` (the backend helpers re-export it) and both suites declare the policy they assume, as the backend suites do. Three bench scenarios sent payloads raak's API refuses: - attachment-churn created attachments without a home; a batch now lands in a seeded bench project. - task-edit and cdc-throughput sent a field timestamp for the `assignedTo` set delta and could name the same user twice in one delta. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
After the 0.18.0 sync,
pnpm testhad two failing yjs integration tests andpnpm bench --allfailed four of its eight scenarios. None of it was a product regression: the tests and the bench payloads did not fit raak's policy and API. This PR makes them fit. No product code changes.Change
permissions.test.tsandrevocation.test.tsexpect that an organization member may update their own attachment; raak's policy gives a memberupdate: 0. The backend suites already declare that assumption withassumeMemberAttachmentPolicy. The helper moves toshared/src/testing/member-policy.ts,backend/tests/security/helpers.tsre-exports it so the seven backend suites that use it are untouched, and both yjs suites call it with{ read: 1, update: 'own', delete: 'own' }.attachment-churn(new in 0.18.0, never passed here). Its create payload carried noprojectId, which raak requires, so every create answered 400 and every delete 403. A batch now lands in a seeded bench project, with a fork marker as inattachment.bench.ts.task-editandcdc-throughput(raak-owned, both useprocessors/task-edits.ts). The assign edit sent a field timestamp forassignedTo, a set delta, which the API refuses: 25% of the requests answered 400. It could also name the same user twice in one delta, which the API refuses as well: rare, but enough to fail a--shortrun. It now sends no timestamp and distinct users.Verification
pnpm checkandpnpm unusedpass.pnpm test: 4909 passed, 0 failed (before: 2 failed). A dev stack was up, so the bench smoke test ran all eight scenarios short.pnpm bench --all, then the two scenarios a dev-stack restart interrupted, each on its own:The latencies come from a laptop that also ran the stack and other work: read them as rough.
Notes for the reviewer
attachment-editfailed its first run on the CDC worker's books check. The first verify after 0.18.0 found 202 counters the old worker had left (200 are the newe:c:h:workspaceande:c:h:projectkeys, 2 are label usage counts from a soft-deleted task) and rebuilt them; every later verify found 0 differences. Production will see the same once, at the first nightly verify (03:00 UTC) after the 0.18.0 deploy: onewrong_booksincident, and connected clients refetch.cdc-throughputstill does not check the worker's record. Its clean run had 25,000 accepted edits and 22,935 recorded activities: an edit that changes nothing writes no row, so counting accepted responses would fail that check.🤖 Generated with Claude Code