Repository navigation
FRONT-4079 test(billing): cover a return to the tab during a pending capabilities read - #23469
Conversation
…s read PR 23437 left one case to do: the path from a return to the tab, through refreshBillingAccount, to the capabilities store's later read. Its other cases call refresh() on the store directly, and billingAccountRefresh.test.ts runs against a mocked store, so nothing ran the two together. The case lives in useBillingCapabilities.test.ts, not in billingAccountRefresh.test.ts as that PR planned. The real store needs the auth, API and rail doubles this file already sets up, and the other file mocks the store for all of its cases.
Swarmhost agentic reviewThe detailed evaluation is available to employees in the internal Slack review thread. Evaluation budget remaining for this pull request: 98 automatic and 99 manual. Updated by Swarmhost's agentic review process. |
🎨 Storybook: ✅ Built — View Storybook🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure
Findings and check detailsExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped. Full docs: scripts/registry-census/README.md Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
🌾 Fallow: ✅ PassedFindings and check detailsFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Full docs: ADR-DEVEX-LINT-0015 Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 642a4d95c76f94ce7501878e6e0d9c47f5af57fb
🏛️ Architecture: ✅ PassedFindings and check detailsWarnings (518)
Full docs: Frontend domain catalog Reproduce locallypnpm architecture:check |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Starting review at a249fa2. |
|
Approving at a249fa2. Clean: Correctness, Resilience, Access, Words, Contract, Vendor, Rollout, Rules, Cause. Not covered:
Checked: Read, not run: event deduplication in ~702k effective tokens for this review (3.2M raw; cache reads weighted 0.1x, cache writes 1.25-2x) |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #23469 +/- ##
==========================================
- Coverage 88.03% 87.94% -0.09%
==========================================
Files 3173 3057 -116
Lines 169943 166193 -3750
Branches 43839 42538 -1301
==========================================
- Hits 149608 146158 -3450
+ Misses 19363 19232 -131
+ Partials 972 803 -169
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
recheck |
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit a249fa2 has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
local_billing_webon,refresh()is not satisfied by a capabilities read that started before the callPart of FRONT-4079. This is the case #23437 listed as "to do, after #23427 merges". Test only.
Summary
Why. #23437 made
refresh()read capabilities once more when a read was already in flight at the call. Its cases callrefresh()on the store directly. #23427's cases runrefreshBillingAccountagainst a mocked store. No test ran the two together: a return to the tab, throughrefreshBillingAccount, to the store's later read.How. One case in
useBillingCapabilities.test.ts, in the block for local withlocal_billing_webon. A first return starts a capabilities read and the test holds it. A second return arrives while it is pending. The case asserts:canTopUpistrue; the held read answeredfalse).Where it lives. #23437 planned this case for
billingAccountRefresh.test.ts. It is inuseBillingCapabilities.test.tsinstead. The real store needs the auth, API and read-rail doubles that file already sets up, andbillingAccountRefresh.test.tsmocks the store for all of its cases. The cost here is one import line.No production code changes.
Feature gate
None needed. The diff is one test file, so nothing changes for a user with
local_billing_webon or off. The case itself runs with the flag on. The flag-off behaviour ofrefresh()is already pinned by "issues no later read for refresh() during a read with local_billing_web off".AS IS / TO BE
No UI change, so there is nothing to screenshot.
Verification
pnpm test:unit src/platform/billing/composables/useBillingCapabilities.test.ts src/platform/billing/billingAccountRefresh.test.ts:Test Files 2 passed (2),Tests 633 passed (633).Mutation checks, each reverted after the run. Both turn the new case red with
expected "vi.fn()" to be called 2 times, but got 1 times:refresh()returns without the later readuseBillingCapabilities.tsif (!latest)in place of the per-event check)billingAccountRefresh.tsThe commit hook ran oxfmt, oxlint,
lint:server-factsandtypecheck:appon the file.Not added: the same case with nothing else holding the store. Here the test's own scope keeps the store alive, as a mounted component does in the app. "holds capabilities only until the read settles" covers the release of the return's scope, against the mocked store.
Not run: the full unit suite, the Playwright suites, and a real return to the tab against Cloud.