Skip to content

[backport cloud/1.57] FE-3441 test(billing): pin cross-user capability guards after dropping the user-id check - #21059

Merged
comfy-pr-bot merged 1 commit into
cloud/1.57from
backport-21006-to-cloud-1.57
Oct 28, 2026
Merged

comfy-pr-bot merged 1 commit into
cloud/1.57from
backport-21006-to-cloud-1.57

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #21006 to cloud/1.57

Automatically created by backport workflow.

…g the user-id check (#21006)

## Summary

Stacked on #21004 (base `fix/billing-capability-read-unified-off`).
#21004 drops the `resolved_for.user_id` check from the capabilities
reader, which was the safety net that stopped one member's rights (an
owner's `can_manage_members` / `can_cancel`) being published as
another's. These tests pin the guards that remain, for the case the
user-id check covered: two accounts in the same team workspace.

Test-only, no production change. No AS IS/TO BE screenshots (no UI
change).

Each remaining guard is pinned by a test that fails when **only that
guard** is removed (owner A, member B, team workspace W; A's answer
carries `can_manage_members` / `can_cancel: true`):

| Guard | Pinned by |
| --- | --- |
| core `sameBillingScope` uid comparison | uid-only switch at the same
role (owner → second owner): A's answer is `SUPERSEDED`, cached snapshot
dropped |
| core scope `generation` | A → B → A before A's first answer lands:
still `SUPERSEDED` |
| composable `authUid` key on read state | A resolved, B signs in:
rights hidden synchronously, before the switch watcher runs |
| composable stale-result fence (try path) | B answers first, A's late
answer must not clobber B; A's refresh `SUPERSEDED` on the SDK rail
after the switch must not restore A's snapshot |
| composable catch path (fence + abort check) | A's refresh fails with
an outage after the switch: B stays ready on its own answer |

The composable cases run on both the legacy client and the SDK rail,
through a typed `BillingReadRail`.

## Verification

- `useBillingCapabilities.crossUser.test.ts` 17 passed;
`capabilitiesCrossUser.test.ts` 8 passed; full `useBillingCapabilities*`
(241) and `account-core/src/core/billing` (755) pass.
- Mutation check, run locally one guard at a time (not committed):
- uid compare off → 2 core failures; generation check off → 1 core
failure.
- `authUid` key off → 2 composable failures; try-path fence off → 3
composable failures.
- catch-path fence alone off → 0 failures: on an account switch the
watcher aborts the request, so the `controller.signal.aborted` check
covers the same case. Removing the fence and the abort check together →
2 failures.
- The earlier version of this PR passed with each composable guard
removed on its own and with the core uid compare removed; this revision
closes those gaps (independent review finding).
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Oct 15, 2026
@comfy-pr-bot
comfy-pr-bot requested review from a team and dante01yoon as code owners October 15, 2026 01:35
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Oct 15, 2026
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) October 15, 2026 01:35
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

⏳ Size data collection in progress…

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 10/15/2026, 01:37:40 AM UTC

Links

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

This candidate changes nothing the matrix measures, so every expensive stage was skipped.

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

Full docs: scripts/registry-census/README.md

🌾 Fallow: ✅ Passed

Fallow 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.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since e1eda8f23790d817579ac2e242deab28d3dba015

Full docs: ADR-DEVEX-LINT-0015

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Oct 15, 2026
@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.57   #21059   +/-   ##
=============================================
  Coverage              ?   86.35%           
=============================================
  Files                 ?     3665           
  Lines                 ?   175103           
  Branches              ?    46226           
=============================================
  Hits                  ?   151207           
  Misses                ?    21880           
  Partials              ?     2016           
Flag Coverage Δ
billing-web-unit 92.40% <ø> (?)
unit 85.02% <ø> (?)
website-unit 80.75% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@comfy-pr-bot
comfy-pr-bot merged commit e42f773 into cloud/1.57 Oct 28, 2026
130 of 131 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-21006-to-cloud-1.57 branch October 28, 2026 16:44

This branch was previously deployed

1 inactive deployment
website-approval — 43941d2d Deployed Oct 15, 2026 by comfy-pr-bot via fast-lane #3660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants