Repository navigation
test(runtime): judge each share-link password pair once in the messages-audience file - #25426
Merged
Merged
Conversation
…es-audience file The file built ShareLinkService with the production scrypt verifier and re-derived a key on every request that presented a password: 30 verifier calls plus 2 password mints, nearly all of its test time. Its beforeAll now wraps the instance's own verifier in a memo keyed by the (password, hash) pair, as share-links-refusal-order.test.ts beside it does, so each of the 4 distinct pairs is judged once by the real verifier and replayed after. Every request, row and assertion is unchanged. Claude-Session: https://claude.ai/code/session_01CxBKycaiUpA1yGx1XyoGqX Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
席位核对ACCEPT ·
Generated by Claude Code |
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.
Requested by Sales · project thread
Part of #23181 (slice 7). The card stays open for later slices.
Clause-②: no
What changes
One test file:
packages/runtime/src/domains/share-links-messages-audience.test.ts. ItsbeforeAllwraps theShareLinkServiceinstance's own password verifier in a memo keyed by the(password, hash)pair. This is the same memoshare-links-refusal-order.test.tsbeside it got in PR #24704. The first request that presents a pair is judged by the production verifier (scrypt at the account parameters). Every later request with that pair gets the same verdict back.What stays the same:
verifyPasswordstops being the member name,beforeAllthrows instead of quietly going back to paying for every call.Measured (local, shared box,
origin/main830a63a680vs this head6e979387cc)Each run is
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/share-links-messages-audience.test.tsunderos-verify-lock. The box is shared, so the ratios are the reading to trust, not the absolute numbers.Durationbefore (wall incl. ~15 s import)Durationafternode:crypto.scrypt(not part of this PR): 32 before (30 verifier calls + 2 password mints), 6 after (4 distinct pairs + 2 mints), the same in all three after-runs. Before, the derivations added up to 3817 ms, which is about the whole per-file duration.39298888283), that projects to about 3.3 s, under the 10 s line. The next refresh's list is the real check.Tests and gates (at
6e979387cc)pnpm --filter @objectstack/runtime test: Test Files 438 passed (438), Tests 7022 passed / 19 skipped; lock VERDICT command-exit 0.pnpm --filter @objectstack/runtime typecheck: lock VERDICT command-exit 0, test layer included (check:test-typecheck: OK).pnpm lint: exit 0.dispatch-gates --commandsderived 54 commands. 53 exited 0.pnpm check:dual-build-cjs-loadsexited 3, PREREQUISITE NOT MET (it needs every package'sdist/, and this worktree built only the runtime closure), so it is NOT MEASURED here. CI's Lint & Repo Gates runs it.--ran: 54 accounted, 53 run, 1 NOT-MEASURED, 0 UNRUN.Changeset
skip-changeset: the only change is a*.test.tsfile.@objectstack/runtimeshipsfiles: [dist, README.md, CHANGELOG.md], and Build Core checks that no compiled test file ends up in any dist.Acceptance notes
beforeAlland is not exported, so it can only be imported after being moved into a shared testkit. Doing that touches the sibling file and adds a new file, which is outside this slice's one-file surface. So the same 13 lines are copied here, and the comment names the sibling. Moving both copies into ashare-link-verifier-memo.testkit.tswould be a small follow-up for whoever owns this lane.🤖 Generated with Claude Code
https://claude.ai/code/session_01CxBKycaiUpA1yGx1XyoGqX
Generated by Claude Code