Repository navigation
fix(billing): return a real state for an unrecognised subscription tier - #14856
christian-byrne wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe changes add explicit billing-policy states for unrecognized tiers. Tier derivation now supports registry and ingest tiers, including ChangesBilling policy fallbacks
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change adds runtime fallbacks for unrecognised billing tiers and states, preventing the affected credits flows from failing; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 1816 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 8.85 MB gzip 🔴 +179 BDetailsSummary
Category Glance App Entry Points — 3.71 kB (baseline 3.71 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.37 MB (baseline 1.37 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 565 kB (baseline 565 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 16 unchanged User & Accounts — 27.7 kB (baseline 27.7 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 125 kB (baseline 125 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 67.1 kB (baseline 67.1 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 8 unchanged Data & Services — 3.52 MB (baseline 3.52 MB) • 🔴 +443 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 550 kB (baseline 550 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 20 unchanged Vendor & Third-Party — 16.8 MB (baseline 16.8 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 14.2 MB (baseline 14.2 MB) • ⚪ 0 BBundles that do not match a named category
Status: 68 added / 68 removed / 218 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-15T01:08:44.764Z",
"gitSha": "8f6fad25dcaa2a7ac34240d5710cf93b9db1981f",
"branch": "fix/billing-policy-unknown-tier-crash",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2049.1269999999986,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.8759999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 383.706,
"heapDeltaBytes": 4971248,
"heapUsedBytes": 69419396,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 6.379000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 1995.6260000000157,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.085999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 367.999,
"heapDeltaBytes": 4912088,
"heapUsedBytes": 69412012,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 5.838000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1789.8519999999962,
"styleRecalcs": 74,
"styleRecalcDurationMs": 36.542,
"layouts": 12,
"layoutDurationMs": 3.2689999999999992,
"taskDurationMs": 709.3430000000001,
"heapDeltaBytes": -790456,
"heapUsedBytes": 63809324,
"domNodes": 58,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 84.729,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1738.8320000000022,
"styleRecalcs": 73,
"styleRecalcDurationMs": 27.914999999999996,
"layouts": 12,
"layoutDurationMs": 2.83,
"taskDurationMs": 674.4050000000001,
"heapDeltaBytes": -18319604,
"heapUsedBytes": 46444820,
"domNodes": 1,
"jsHeapTotalBytes": 23564288,
"scriptDurationMs": 80.022,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1682.8869999999938,
"styleRecalcs": 31,
"styleRecalcDurationMs": 12.575000000000001,
"layouts": 6,
"layoutDurationMs": 0.522,
"taskDurationMs": 291.37399999999997,
"heapDeltaBytes": 7917200,
"heapUsedBytes": 72313536,
"domNodes": 77,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 8.198,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1709.2069999999921,
"styleRecalcs": 31,
"styleRecalcDurationMs": 13.038,
"layouts": 6,
"layoutDurationMs": 0.5300000000000001,
"taskDurationMs": 292.36,
"heapDeltaBytes": 8052600,
"heapUsedBytes": 72419072,
"domNodes": 78,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 8.049000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 475.62899999999786,
"styleRecalcs": 12,
"styleRecalcDurationMs": 6.559,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 296.974,
"heapDeltaBytes": -12107348,
"heapUsedBytes": 52356136,
"domNodes": 20,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 42.6,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 455.9229999999843,
"styleRecalcs": 12,
"styleRecalcDurationMs": 6.6869999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 288.72200000000004,
"heapDeltaBytes": -11384632,
"heapUsedBytes": 53271668,
"domNodes": 20,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 41.977000000000004,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2012.7640000000042,
"styleRecalcs": 9,
"styleRecalcDurationMs": 5.738,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 469.281,
"heapDeltaBytes": 10037392,
"heapUsedBytes": 69603264,
"domNodes": -282,
"jsHeapTotalBytes": 2195456,
"scriptDurationMs": 12.515000000000002,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2000.838999999985,
"styleRecalcs": 9,
"styleRecalcDurationMs": 5.842999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 479.856,
"heapDeltaBytes": 12474996,
"heapUsedBytes": 72821052,
"domNodes": -282,
"jsHeapTotalBytes": 2719744,
"scriptDurationMs": 12.184000000000005,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2087.471999999991,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.381000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 923.9810000000001,
"heapDeltaBytes": 10047448,
"heapUsedBytes": 70576144,
"domNodes": -282,
"jsHeapTotalBytes": 3698688,
"scriptDurationMs": 273.361,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2083.3229999999503,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.270999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 892.68,
"heapDeltaBytes": 9369056,
"heapUsedBytes": 69735576,
"domNodes": -282,
"jsHeapTotalBytes": 3436544,
"scriptDurationMs": 238.97599999999997,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3070.8060000000046,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.763000000000002,
"layouts": 60,
"layoutDurationMs": 6.699,
"taskDurationMs": 1022.4359999999999,
"heapDeltaBytes": 16837236,
"heapUsedBytes": 79053620,
"domNodes": 14,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 300.75600000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3108.5630000000037,
"styleRecalcs": 66,
"styleRecalcDurationMs": 13.781999999999998,
"layouts": 60,
"layoutDurationMs": 6.639999999999999,
"taskDurationMs": 1097.7920000000001,
"heapDeltaBytes": -8481188,
"heapUsedBytes": 53839912,
"domNodes": -284,
"jsHeapTotalBytes": 2719744,
"scriptDurationMs": 305.238,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2007.994999999994,
"styleRecalcs": 8,
"styleRecalcDurationMs": 4.981999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 461.82800000000003,
"heapDeltaBytes": 12618000,
"heapUsedBytes": 73855864,
"domNodes": -282,
"jsHeapTotalBytes": 1933312,
"scriptDurationMs": 11.004999999999997,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2011.1469999999372,
"styleRecalcs": 9,
"styleRecalcDurationMs": 5.911999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 483.059,
"heapDeltaBytes": 10308800,
"heapUsedBytes": 71611328,
"domNodes": -282,
"jsHeapTotalBytes": 2981888,
"scriptDurationMs": 12.371000000000004,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 505.4719999999975,
"styleRecalcs": 47,
"styleRecalcDurationMs": 9.003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 313.902,
"heapDeltaBytes": -10811152,
"heapUsedBytes": 53827732,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 96.717,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 520.518999999922,
"styleRecalcs": 49,
"styleRecalcDurationMs": 9.323999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 314.84499999999997,
"heapDeltaBytes": -10774332,
"heapUsedBytes": 53868588,
"domNodes": 22,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 93.303,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-idle",
"durationMs": 2005.4000000000087,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.253000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 358.42,
"heapDeltaBytes": 5275428,
"heapUsedBytes": 69977232,
"domNodes": 22,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 5.757,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2000.9829999999624,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.4369999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 355.85599999999994,
"heapDeltaBytes": 5040008,
"heapUsedBytes": 69728032,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 5.419000000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1671.796000000029,
"styleRecalcs": 77,
"styleRecalcDurationMs": 26.634999999999998,
"layouts": 16,
"layoutDurationMs": 3.0689999999999995,
"taskDurationMs": 573.093,
"heapDeltaBytes": -4377044,
"heapUsedBytes": 60330344,
"domNodes": 64,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 62.510999999999996,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1669.0519999999651,
"styleRecalcs": 75,
"styleRecalcDurationMs": 26.854,
"layouts": 16,
"layoutDurationMs": 3.2529999999999997,
"taskDurationMs": 574.8539999999999,
"heapDeltaBytes": -4068600,
"heapUsedBytes": 60632216,
"domNodes": 62,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 63.989999999999995,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 883.5659999999734,
"styleRecalcs": 20,
"styleRecalcDurationMs": 23.265000000000008,
"layouts": 15,
"layoutDurationMs": 9.174999999999999,
"taskDurationMs": 707.2400000000001,
"heapDeltaBytes": -6018020,
"heapUsedBytes": 77684492,
"domNodes": 13673,
"jsHeapTotalBytes": 10485760,
"scriptDurationMs": 11.442,
"eventListeners": 2373,
"totalBlockingTimeMs": 84,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8132.418999999971,
"styleRecalcs": 249,
"styleRecalcDurationMs": 34.82,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3183.475,
"heapDeltaBytes": 18431800,
"heapUsedBytes": 78051484,
"domNodes": -284,
"jsHeapTotalBytes": 2912256,
"scriptDurationMs": 808.187,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8157.851999999992,
"styleRecalcs": 249,
"styleRecalcDurationMs": 36.33,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3211.558,
"heapDeltaBytes": 13549872,
"heapUsedBytes": 73468752,
"domNodes": -282,
"jsHeapTotalBytes": 5009408,
"scriptDurationMs": 770.2470000000001,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 14522.377000000006,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13715.460000000003,
"heapDeltaBytes": -39290480,
"heapUsedBytes": 171913408,
"domNodes": -8312,
"jsHeapTotalBytes": -7544832,
"scriptDurationMs": 98.11100000000002,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 14562.504999999986,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13869.936000000002,
"heapDeltaBytes": -39761056,
"heapUsedBytes": 171536308,
"domNodes": -8312,
"jsHeapTotalBytes": -8327168,
"scriptDurationMs": 90.79699999999998,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17119.080999999995,
"styleRecalcs": 153,
"styleRecalcDurationMs": 14.80999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16556.684999999998,
"heapDeltaBytes": -42642520,
"heapUsedBytes": 182545980,
"domNodes": -8312,
"jsHeapTotalBytes": -15966208,
"scriptDurationMs": 325.81300000000005,
"eventListeners": -16387,
"totalBlockingTimeMs": 45,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17007.76199999996,
"styleRecalcs": 146,
"styleRecalcDurationMs": 14.755999999999991,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16447.986,
"heapDeltaBytes": -28356288,
"heapUsedBytes": 182510000,
"domNodes": -8312,
"jsHeapTotalBytes": -4206592,
"scriptDurationMs": 335.24399999999997,
"eventListeners": -16387,
"totalBlockingTimeMs": 13,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 442.1909999999798,
"styleRecalcs": 18,
"styleRecalcDurationMs": 18.174,
"layouts": 3,
"layoutDurationMs": 1.0900000000000003,
"taskDurationMs": 96.986,
"heapDeltaBytes": 5089508,
"heapUsedBytes": 68949108,
"domNodes": 150,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 6.548,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 433.65400000004684,
"styleRecalcs": 13,
"styleRecalcDurationMs": 13.823,
"layouts": 2,
"layoutDurationMs": 0.3480000000000001,
"taskDurationMs": 83.28500000000001,
"heapDeltaBytes": 4930572,
"heapUsedBytes": 68601144,
"domNodes": 123,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 5.415000000000002,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #14856 +/- ##
=======================================
Coverage 81.88% 81.88%
=======================================
Files 1884 1884
Lines 118158 118170 +12
Branches 35703 35707 +4
=======================================
+ Hits 96751 96765 +14
+ Misses 20962 20951 -11
- Partials 445 454 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes 🚀 New features to boost your workflow:
|
dante01yoon
left a comment
There was a problem hiding this comment.
While the current “allowed fallback” may be a reasonable choice that prioritizes availability, logging the “unknown tier” in telemetry can help reduce the risk of silently masking future policy discrepancies.
| default: { | ||
| const unhandledState: never = state | ||
| void unhandledState | ||
| return { topUpAccess: 'allowed', showsSubscribeUpsellUI: false } |
There was a problem hiding this comment.
Issue: This is inconsistent with the current policy that requires a subscription to add credits. While it’s better than the screen freezing, “Add credits” may still be allowed even in future tiers that require restrictions.
There was a problem hiding this comment.
Changed to subscription-required with no upsell.
You are right that the old arm was inconsistent. Reaching it means deriveBillingPolicyState and this table have drifted, which is not a state to grant credit purchase on. The arm stays reachable-at-runtime on purpose (that is the crash this PR fixes), it just no longer fails open.
|
Good catch, and you are right about the test. Fixed in 608d920 — the unrecognised-tier case now uses a synthetic On whether the two PRs collide: they overlap textually in #14839 adopts Put together: #14839 removes today's trigger, #14856 makes the landing safe for the next one. I would rather have both than either. Happy to take the rebase whichever way you prefer — if #14839 lands first I will rebase onto it and drop nothing, since my change is confined to the One thing worth flagging separately: the earlier lowercase-tier e2e failure on #14591 was fixed by editing the fixture ( |
I lean on land 14839 first and rebase this PR |
|
Handoff note — this work moved to @Jaewon under FE-1585 (Billing Code Red PR triage). My recommendation there: Finish, and treat it as the highest priority of the five open frontend billing PRs. It fixes a Verified red-green: the new tests fail against unfixed source with Per @dante01yoon's earlier note, the test now uses a synthetic tier rather than |
|
Handoff: I'm off the Cloud billing pod, so @dante01yoon owns this now and I've reassigned it to him. Context that isn't obvious from the assignee change alone: this is one of five of my open billing PRs moved to him on 2026-08-13 (#14867, #14866, #14856, #14865, #14477). They're independent of each other and none is urgent. All of them predate the flag-retirement stack merging, so rebase and re-check CI before reviewing rather than trusting the last green run. The two that are not in that set and do need thought first: #14964 has changes requested, and #15078 is draft, conflicting, and overlaps #15094 on subscription-status fetch races. Don't revive #15078 without reading #15094 first. The live one is #15094, a defect that shipped with the retirement stack. That takes priority over anything here. |
dante01yoon
left a comment
There was a problem hiding this comment.
Requesting one contract/policy correction before merge. The crash is real, but the fallback should not infer a purchase entitlement for a server tier this frontend does not understand.
| default: { | ||
| const unhandledTier: never = input.tier | ||
| void unhandledTier | ||
| return { kind: `${distribution}AndUnknown` } |
There was a problem hiding this comment.
issue: This maps every future server tier to ...AndUnknown; on Cloud that existing state maps to topUpAccess: 'allowed', and the new default in billingPolicyCapabilities.ts also fails open. That invents a billing entitlement for a server value this build does not understand. The current mismatch is concrete: this head's generated @comfyorg/ingest-types SubscriptionTier already includes TEAM, while this function uses the Registry tier type that does not. Could we fix the known case from the generated ingest contract and handle TEAM explicitly, then make genuinely unknown runtime values fail closed (or consume an explicit backend capability)? New tiers should follow the contract-first API/generated-types workflow rather than relying on a permissive frontend fallback.
There was a problem hiding this comment.
Done, both halves.
TEAM is now a compile-time case. deriveBillingPolicyState takes the union of the two generated contracts (RegistrySubscriptionTier | IngestSubscriptionTier), so case 'TEAM' typechecks and maps to the existing ${distribution}AndTeam state instead of falling through. That also means the test no longer needs a cast to reach it.
Genuinely unknown values fail closed. They get their own Local/CloudAndUnrecognizedTier state rather than borrowing ...AndUnknown, whose Cloud row grants top-up. CloudAndUnrecognizedTier is subscription-required with showsSubscribeUpsellUI: false, since the account does have canAccessSubscriptionFeatures and a Subscribe CTA would be wrong. Local stays allowed, consistent with every other Local row, and infers nothing (Local allows top-up without a subscription anyway).
One consequence worth naming: a Cloud account on a tier newer than the build now cannot add credits and gets no CTA. That is the fail-closed trade you asked for, and it is narrower than before since TEAM no longer lands there. Agreed on contract-first for new tiers.
deriveBillingPolicyState ended its tier switch with `return input.tier satisfies never`. satisfies is erased at build time, so an unrecognised tier returned the raw string instead of a state object. getBillingPolicyCapabilities then switched on state.kind (undefined), matched nothing, and having no default arm returned undefined, which dialogService and CreditsTile dereference unguarded. The backend can send a tier the registry union does not carry: ingest declares TEAM, the registry SubscriptionTier does not, and isTeamPlan is a plan_slug heuristic that does not catch every team workspace. The result was a TypeError that stopped the top-up dialog from opening and left the credits tile blank. Both switches now keep compile-time exhaustiveness via a never assignment and return a usable value at runtime.
TEAM stops being unrecognised once #14839 adopts the ingest tier union and maps it to CloudAndTeam/LocalAndTeam. The fallback exists for whatever tier the backend adds next, so the test should not name a tier that is about to become known.
…d it
The two generated contracts disagree on SubscriptionTier: the registry spec
stops at FOUNDERS_EDITION, the ingest spec also declares TEAM. Widening the
derivation input to the union makes TEAM a compile-time case that maps to
the existing ${distribution}AndTeam state instead of falling through.
Values in neither contract are genuinely unknown to this build, so they get
their own state rather than borrowing ...AndUnknown, whose Cloud row grants
top-up. On Cloud an unrecognised tier is now subscription-required with no
upsell, so the frontend stops inferring a purchase entitlement for a server
value it cannot interpret.
Addresses review feedback:
#14856 (comment)
The unreachable arm returned topUpAccess: 'allowed', so a state.kind this build cannot interpret granted credit purchase — the opposite of the policy that every Cloud row without an entitlement encodes. Reaching it means the derivation and this table have drifted, which is not a case to grant access on. It now returns subscription-required with no upsell. Addresses review feedback: #14856 (comment)
608d920 to
0342b5b
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Closing per your note on #15403 — taking the option where this one closes and #15403 absorbs the fix, so the two PRs don't both land on the same five files before the 24th. Absorbed in e6ff545:
Your One deliberate difference, with the reasoning on #15403: Thanks for catching the fail-open entitlement. |
Summary
deriveBillingPolicyState(added in #14591) ended its tier switch withreturn input.tier satisfies never.satisfiesis erased at build time, so an unrecognised tier returned the raw string instead of a state object.getBillingPolicyCapabilitiesthen switched onstate.kind(undefined), matched no case, and — having nodefault:arm — returnedundefined. Both consumers (dialogService.ts:340,CreditsTile.vue:191) dereference that unguarded, so it is aTypeError.Why it is reachable
The registry
SubscriptionTierenumerates five members (tierPricing.tsTIER_TO_KEY), which is whysatisfies nevercompiles. Butpackages/ingest-types/src/types.gen.tsdeclaresTEAM. The two generated type sources disagree. TheisTeamPlanbranch catches most team accounts first, but it is aplan_slugheuristic (useBillingContext.ts), so a team workspace whose slug does not match falls through to the switch.User-visible result: Add credits never opens and the Credits tile renders blank — the same flow the original local-credits P0 broke.
Change
Both switches keep compile-time exhaustiveness through a
neverassignment, and return a usable value at runtime:${distribution}AndUnknownstatetopUpAccess: 'allowed', no upsell — degrading toward letting a paying customer spend rather than locking them outTests
Both new tests were confirmed to fail against the unfixed source, with the exact diagnosed symptoms:
The existing table types
tierasParameters<typeof deriveBillingPolicyState>[0]['tier'], so the crashing branch was structurally impossible to cover; the new cases cast deliberately to reach it.pnpm typecheckexit 0, 34 tests pass.