Skip to content

billing: resolve the top-up deep link against server capabilities - #15805

Closed
wei-hai wants to merge 2 commits into
wei/be-8716-c-migrate-consumersfrom
wei/be-8716-d-topup-deeplink
Closed

wei-hai wants to merge 2 commits into
wei/be-8716-c-migrate-consumersfrom
wei/be-8716-d-topup-deeplink

Conversation

@wei-hai

@wei-hai wei-hai commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Moves the ?topup= deep-link decision onto the server-resolved capabilities.

Includes the initialization-race fix from review. The loader awaits initialize() before reading canTopUp / canSubscribeSelfServe, so an eligible user no longer loses the deep link when the decision would otherwise be evaluated while both flags are still at their initial false. Its regression coverage is in the updated test alongside it.

Isolated so that fix and its test are reviewable without the migration diff around them.

Split out of #15641. Based on #15804.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 24, 2026
@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f3a50821-54d3-4ab8-81a6-043740802d54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ❌ 1989 passed, 2 failed · 1 flaky

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 1968 / ❌ 2 / ⚠️ 1 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: 🚧 Building...

The delete and the migration ride together because removing the policy while a
consumer still imports it would not build.
Awaits capability initialization before reading the flags, so an eligible user
does not lose the deep link while both are still at their initial false.
@wei-hai
wei-hai force-pushed the wei/be-8716-c-migrate-consumers branch from 0dfc09a to 20d71f0 Compare August 24, 2026 18:55
@wei-hai
wei-hai force-pushed the wei/be-8716-d-topup-deeplink branch from 09d5ade to 0af6f0e Compare August 24, 2026 18:55
@wei-hai
wei-hai force-pushed the wei/be-8716-c-migrate-consumers branch from 20d71f0 to 0894b5c Compare August 24, 2026 19:00
@wei-hai

wei-hai commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Closing — folded into #15804.

The split put useTopUpUrlLoader.ts here, but #15804 removes canTopUp from WorkspacePermissions, and this file reads it. That made #15804 fail to typecheck on its own:

useTopUpUrlLoader.ts(58,28): error TS2339:
  Property 'canTopUp' does not exist on type 'WorkspacePermissions'

A PR that cannot build in isolation is worse than a slightly larger one, so the deep-link loader and its test now ride with the type change that requires them. The initialization-race fix and its regression test moved along with it.

@wei-hai wei-hai closed this Aug 24, 2026
@wei-hai
wei-hai deleted the wei/be-8716-d-topup-deeplink branch August 24, 2026 19:00
@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Aug 24, 2026
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.00000% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../components/TopUpCreditsDialogContentWorkspace.vue 0.00% 6 Missing ⚠️
...rkspace/components/CurrentUserPopoverWorkspace.vue 28.57% 1 Missing and 4 partials ⚠️
src/components/topbar/CurrentUserPopoverLegacy.vue 0.00% 3 Missing ⚠️
...platform/workspace/stores/billingOperationStore.ts 0.00% 3 Missing ⚠️
...c/platform/workspace/composables/useWorkspaceUI.ts 0.00% 0 Missing and 1 partial ⚠️
@@                        Coverage Diff                        @@
##           wei/be-8716-c-migrate-consumers   #15805    +/-   ##
=================================================================
  Coverage                            82.41%   82.41%            
=================================================================
  Files                                 1922     1921     -1     
  Lines                               109289   109438   +149     
  Branches                             30404    30325    -79     
=================================================================
+ Hits                                 90067    90198   +131     
- Misses                               18883    18907    +24     
+ Partials                               339      333     -6     
Flag Coverage Δ
e2e 67.11% <28.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
...form/cloud/subscription/components/CreditsTile.vue 98.88% <ø> (-0.06%) ⬇️
...loud/subscription/composables/useTopUpUrlLoader.ts 94.73% <ø> (-1.70%) ⬇️
...omponents/dialogs/settings/BillingStatusBanner.vue 96.77% <ø> (-0.20%) ⬇️
src/services/dialogService.ts 61.78% <100.00%> (-0.41%) ⬇️
src/storybook/mocks/useWorkspaceUI.ts 0.00% <ø> (ø)
...c/platform/workspace/composables/useWorkspaceUI.ts 94.91% <0.00%> (-1.70%) ⬇️
src/components/topbar/CurrentUserPopoverLegacy.vue 90.90% <0.00%> (-3.54%) ⬇️
...platform/workspace/stores/billingOperationStore.ts 94.71% <0.00%> (-1.05%) ⬇️
...rkspace/components/CurrentUserPopoverWorkspace.vue 80.76% <28.57%> (-4.85%) ⬇️
.../components/TopUpCreditsDialogContentWorkspace.vue 81.15% <0.00%> (-3.55%) ⬇️

... and 21 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.

@huang47 huang47 added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:xhigh PR risk grade (advisory shadow check; grader-owned) size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants