Skip to content

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

Closed
comfy-pr-bot wants to merge 1 commit into
core/1.57from
backport-21006-to-core-1.57
Closed

comfy-pr-bot wants to merge 1 commit into
core/1.57from
backport-21006-to-core-1.57

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #21006 to core/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).
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle: ⏳ Size data collection in progress…

🔬 E2E Coverage: ⚠️ Coverage collection failed — check the CI workflow logs

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 10/15/2026, 01:37:39 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 04e20247a66200a63af441328ae4fe3c1c57bb4f

Full docs: ADR-DEVEX-LINT-0015

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##           core/1.57   #21058      +/-   ##
=============================================
- Coverage      87.16%   86.34%   -0.82%     
=============================================
  Files           2612     3665    +1053     
  Lines         146878   175105   +28227     
  Branches       40269    48309    +8040     
=============================================
+ Hits          128021   151194   +23173     
- Misses         18469    21895    +3426     
- Partials         388     2016    +1628     
Flag Coverage Δ
billing-web-unit 92.40% <ø> (?)
website-unit 80.75% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1053 files with indirect coverage changes

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

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

datadog-official Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 3 Pipeline jobs failed

CI: Tests E2E | test

View in Datadog · View in GitHub Actions

CI: Tests E2E | unit / test

View in Datadog · View in GitHub Actions

CI: Tests E2E | unit / test-packages

View in Datadog · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7557b40 | Docs | View more details | Give us feedback!

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — approving backport.

@dante01yoon dante01yoon removed their assignment Oct 28, 2026
@christian-byrne

Copy link
Copy Markdown
Contributor

Closing — this backport cannot go green on core/1.57, and it should not.

The pin asserts the behaviour that lands with #21004 ("accept the server's own user id on the capabilities read"), which replaced the two-part user_id + workspace_id guard in capabilities.ts with a workspace-only check. That production change was released to the cloud trains only — cloud/1.56 (#21012) and cloud/1.57 (#21013) — and no core carrier was ever opened for it. core/1.57 therefore still has the two-part guard, so 5 of the 8 assertions here fail with expected 'error' to be 'ok', which is the correct result on that branch.

This carrier exists only because the core/1.57 label was applied to the test PR #21006 while the fix it pins carried cloud/1.56 and cloud/1.57. The matching cloud/1.57 carrier, #21059, merged on 2026-10-28.

Closing loses no coverage. Both pins are already on every train that has the fix:

If the capabilities fix is ever wanted on core/1.57, the fix needs a carrier first and this pin can be reopened behind it.

auto-merge was automatically disabled November 4, 2026 23:26

Pull request was closed

This branch was previously deployed

1 inactive deployment
website-approval — 7557b405 Deployed Oct 15, 2026 by comfy-pr-bot via fast-lane #3658
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.

4 participants