Repository navigation
fix: never render the cloud sign-up email form before region detection settles - #14945
Conversation
…n settles isInChina() races a fetch against a 2000ms timeout, but userIsInChina defaulted to false, so the email sign-up form rendered immediately and was replaced by the region notice up to ~2s later. The form was briefly interactive, letting a fast typist begin entering the PII the region policy exists to avoid collecting. Model detection as boolean | undefined and render a skeleton placeholder while it is pending, so the form only ever appears once detection resolves to false. Detection still starts on mount, so the common path usually settles before the user switches to the email tab. Social sign-up is unchanged and never waits on the probe. Sign-in remains unguarded by design, since an existing account already completed sign-up; both are pinned by tests.
🎭 Playwright: ✅ 1802 passed, 0 failed · 3 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 8.72 MB gzip 🔴 +1.29 kBDetailsSummary
Category Glance App Entry Points — 3.67 kB (baseline 3.67 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.36 MB (baseline 1.36 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • 🔴 +397 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.6 kB (baseline 27 kB) • 🔴 +527 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 4 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.51 MB (baseline 3.51 MB) • 🔴 +2.07 kBStores, 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.3 MB (baseline 16.3 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 17 unchanged Other — 14.1 MB (baseline 14.1 MB) • 🔴 +352 BBundles that do not match a named category
Status: 68 added / 68 removed / 217 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-12T17:08:37.440Z",
"gitSha": "f4e5cd44179ce72db6c09f64ff309c4ee013ab58",
"branch": "fix/cloud-signup-china-detection-flash",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2044.0490000000295,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.520999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 508.0709999999999,
"heapDeltaBytes": 5787188,
"heapUsedBytes": 70270064,
"domNodes": 18,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 21.578999999999997,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2017.9980000000342,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.774000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 476.541,
"heapDeltaBytes": 5794736,
"heapUsedBytes": 70206340,
"domNodes": 16,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 17.199,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2007.5560000000223,
"styleRecalcs": 77,
"styleRecalcDurationMs": 45.147,
"layouts": 12,
"layoutDurationMs": 3.9330000000000007,
"taskDurationMs": 1071.084,
"heapDeltaBytes": -11971736,
"heapUsedBytes": 52369232,
"domNodes": -281,
"jsHeapTotalBytes": 24354816,
"scriptDurationMs": 135.66500000000002,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1875.0289999999268,
"styleRecalcs": 77,
"styleRecalcDurationMs": 40.88999999999999,
"layouts": 12,
"layoutDurationMs": 3.611,
"taskDurationMs": 865.197,
"heapDeltaBytes": -71600,
"heapUsedBytes": 64342012,
"domNodes": 60,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 121.08099999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1740.6159999999886,
"styleRecalcs": 33,
"styleRecalcDurationMs": 18.633999999999997,
"layouts": 6,
"layoutDurationMs": 0.6579999999999999,
"taskDurationMs": 420.789,
"heapDeltaBytes": 8805108,
"heapUsedBytes": 73407568,
"domNodes": 78,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 24.058999999999997,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1754.921999999965,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.706,
"layouts": 6,
"layoutDurationMs": 0.7269999999999998,
"taskDurationMs": 448.37399999999997,
"heapDeltaBytes": 8678140,
"heapUsedBytes": 72981972,
"domNodes": 77,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 27.375000000000004,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 637.4839999999722,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.422000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 398.589,
"heapDeltaBytes": -11228460,
"heapUsedBytes": 53121020,
"domNodes": 16,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 60.674,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 629.7120000000405,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.324999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 390.62899999999996,
"heapDeltaBytes": -11368196,
"heapUsedBytes": 53216376,
"domNodes": 18,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 58.43399999999999,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2040.9870000000296,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.766000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 763.025,
"heapDeltaBytes": 7747256,
"heapUsedBytes": 67953256,
"domNodes": -283,
"jsHeapTotalBytes": 3772416,
"scriptDurationMs": 118.976,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2026.1490000000322,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.7970000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 685.9220000000001,
"heapDeltaBytes": 6980408,
"heapUsedBytes": 66476276,
"domNodes": -284,
"jsHeapTotalBytes": 3772416,
"scriptDurationMs": 101.37899999999998,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2212.9639999999995,
"styleRecalcs": 69,
"styleRecalcDurationMs": 15.291999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1300.029,
"heapDeltaBytes": 4834840,
"heapUsedBytes": 65450768,
"domNodes": -284,
"jsHeapTotalBytes": 3964928,
"scriptDurationMs": 419.791,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2179.4949999999744,
"styleRecalcs": 69,
"styleRecalcDurationMs": 15.356999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1265.6719999999998,
"heapDeltaBytes": 5186820,
"heapUsedBytes": 65729140,
"domNodes": -283,
"jsHeapTotalBytes": 3964928,
"scriptDurationMs": 408.52200000000005,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3231.0879999999997,
"styleRecalcs": 64,
"styleRecalcDurationMs": 15.332000000000003,
"layouts": 60,
"layoutDurationMs": 8.391,
"taskDurationMs": 1587.48,
"heapDeltaBytes": 800072,
"heapUsedBytes": 63012740,
"domNodes": -291,
"jsHeapTotalBytes": 6656000,
"scriptDurationMs": 544.241,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3231.1770000000024,
"styleRecalcs": 65,
"styleRecalcDurationMs": 15.657999999999998,
"layouts": 60,
"layoutDurationMs": 8.292000000000002,
"taskDurationMs": 1538.9669999999999,
"heapDeltaBytes": -1823240,
"heapUsedBytes": 61157360,
"domNodes": -287,
"jsHeapTotalBytes": 6393856,
"scriptDurationMs": 530.5980000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2038.3879999999976,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.457999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 780.1309999999999,
"heapDeltaBytes": 7027188,
"heapUsedBytes": 67556224,
"domNodes": -283,
"jsHeapTotalBytes": 3510272,
"scriptDurationMs": 118.171,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2033.7970000000496,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.884000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 838.464,
"heapDeltaBytes": 6941552,
"heapUsedBytes": 68167252,
"domNodes": -283,
"jsHeapTotalBytes": 3248128,
"scriptDurationMs": 127.196,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 610.6270000000222,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.207999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 418.795,
"heapDeltaBytes": -10801824,
"heapUsedBytes": 53962684,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 125.558,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 591.7409999999563,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.713,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 421.162,
"heapDeltaBytes": -11059552,
"heapUsedBytes": 53498620,
"domNodes": 18,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 126.98499999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2037.6039999999875,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.289000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 605.458,
"heapDeltaBytes": -17585868,
"heapUsedBytes": 46951216,
"domNodes": -279,
"jsHeapTotalBytes": 23044096,
"scriptDurationMs": 20.502,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1995.2779999999848,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.928000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 504.87000000000006,
"heapDeltaBytes": 5863812,
"heapUsedBytes": 70447856,
"domNodes": 20,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 17.757,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1767.1189999999797,
"styleRecalcs": 79,
"styleRecalcDurationMs": 41.965,
"layouts": 16,
"layoutDurationMs": 5.343999999999999,
"taskDurationMs": 885.1470000000002,
"heapDeltaBytes": -18845020,
"heapUsedBytes": 45816560,
"domNodes": 62,
"jsHeapTotalBytes": 23306240,
"scriptDurationMs": 107.41099999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1710.8879999999544,
"styleRecalcs": 76,
"styleRecalcDurationMs": 38.20900000000001,
"layouts": 16,
"layoutDurationMs": 4.544,
"taskDurationMs": 829.086,
"heapDeltaBytes": -16947916,
"heapUsedBytes": 47593088,
"domNodes": -279,
"jsHeapTotalBytes": 22781952,
"scriptDurationMs": 93.59500000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.1029999999778,
"styleRecalcs": 18,
"styleRecalcDurationMs": 30.033000000000005,
"layouts": 14,
"layoutDurationMs": 11.771,
"taskDurationMs": 982.0339999999999,
"heapDeltaBytes": 31002420,
"heapUsedBytes": 99412060,
"domNodes": 13673,
"jsHeapTotalBytes": 14942208,
"scriptDurationMs": 35.525,
"eventListeners": 2375,
"totalBlockingTimeMs": 117,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8323.823000000004,
"styleRecalcs": 251,
"styleRecalcDurationMs": 44.032,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4783.143,
"heapDeltaBytes": 10951944,
"heapUsedBytes": 70557376,
"domNodes": -282,
"jsHeapTotalBytes": 5013504,
"scriptDurationMs": 1384.125,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8397.416000000021,
"styleRecalcs": 250,
"styleRecalcDurationMs": 43.32000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4742.919,
"heapDeltaBytes": 12806368,
"heapUsedBytes": 72225620,
"domNodes": -281,
"jsHeapTotalBytes": 6586368,
"scriptDurationMs": 1385.8129999999999,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 18288.96199999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18264.825,
"heapDeltaBytes": -36608492,
"heapUsedBytes": 167533388,
"domNodes": -8312,
"jsHeapTotalBytes": -9117696,
"scriptDurationMs": 592.217,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 18424.622999999996,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18364.585,
"heapDeltaBytes": -36236764,
"heapUsedBytes": 168001140,
"domNodes": -8312,
"jsHeapTotalBytes": -8593408,
"scriptDurationMs": 558.418,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 22951.527,
"styleRecalcs": 170,
"styleRecalcDurationMs": 26.91699999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22927.096,
"heapDeltaBytes": -60279708,
"heapUsedBytes": 164673472,
"domNodes": -8312,
"jsHeapTotalBytes": -7806976,
"scriptDurationMs": 950.0409999999999,
"eventListeners": -16379,
"totalBlockingTimeMs": 920,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 22802.595999999994,
"styleRecalcs": 168,
"styleRecalcDurationMs": 26.856999999999964,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22777.648,
"heapDeltaBytes": -63377376,
"heapUsedBytes": 156453216,
"domNodes": -8312,
"jsHeapTotalBytes": -9117696,
"scriptDurationMs": 952.6850000000001,
"eventListeners": -16381,
"totalBlockingTimeMs": 738,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 451.25000000007276,
"styleRecalcs": 14,
"styleRecalcDurationMs": 23.232000000000003,
"layouts": 4,
"layoutDurationMs": 1.3539999999999996,
"taskDurationMs": 118.206,
"heapDeltaBytes": 5060840,
"heapUsedBytes": 68482896,
"domNodes": 126,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 10.754,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 464.5390000000589,
"styleRecalcs": 14,
"styleRecalcDurationMs": 20.281,
"layouts": 2,
"layoutDurationMs": 0.3539999999999999,
"taskDurationMs": 111.43000000000002,
"heapDeltaBytes": 5040780,
"heapUsedBytes": 68706880,
"domNodes": 125,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 10.576,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRegion detection now uses bounded CDN and connectivity probes. A shared ChangesRegion detection and onboarding gating
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SignupView
participant useRegionGate
participant isInChina
User->>SignupView: Open signup
SignupView->>useRegionGate: Read region status
useRegionGate->>isInChina: Detect region
isInChina-->>useRegionGate: Resolve blocked or allowed
useRegionGate-->>SignupView: Update status
SignupView-->>User: Show skeleton, restriction, or signup form
Suggested reviewers: 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)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/platform/cloud/onboarding/CloudLoginView.test.ts`:
- Line 2: Update the sign-in test to exercise the user-visible flow through
accessible form fields and submit the form, then assert that normal sign-in
completes without a region check. Remove the readFile import and source-text
assertion, replace getByTestId('signin-form') with accessible queries, and keep
the assertions focused on observable behavior rather than implementation
details.
In `@src/platform/cloud/onboarding/CloudSignupView.test.ts`:
- Around line 150-154: Update the test cases around each settle call in
CloudSignupView tests to await Vue’s nextTick immediately after detector
resolution, including the additional occurrence around the second settle block.
Keep the existing waitFor assertion where still necessary.
In `@src/platform/cloud/onboarding/CloudSignupView.vue`:
- Around line 108-109: Update the China-region detection flow using
userIsInChina so rejected isInChina requests are handled instead of leaving the
value undefined. Set a defined fallback of false with an actionable error/retry
path, or introduce a separate error state, while preserving the existing
China-restriction behavior and allowing SignUpForm to render after failure.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 314ff9fe-163f-449e-87b9-eb26b4971119
📒 Files selected for processing (3)
src/platform/cloud/onboarding/CloudLoginView.test.tssrc/platform/cloud/onboarding/CloudSignupView.test.tssrc/platform/cloud/onboarding/CloudSignupView.vue
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #14945 +/- ##
==========================================
- Coverage 81.38% 78.82% -2.56%
==========================================
Files 1882 1880 -2
Lines 106575 116303 +9728
Branches 33764 34165 +401
==========================================
+ Hits 86735 91679 +4944
- Misses 19495 24077 +4582
- Partials 345 547 +202
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 511 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
Reviewed at c756d24. The undefined-pending model is the right shape, and the race it closes is more serious than the description claims: the form isn't just briefly visible, it's briefly live, so a user inside the window can submit and create the account rather than merely start typing. That's a policy hole, not a cosmetic flash.
Two things to fix before this lands, one scope addition, and a suggestion about the detector itself.
Must fix: the pending state has no guaranteed exit
Detail inline on CloudSignupView.vue. In short: isInChina() bounds only its Google leg (2000 ms race); its catch path then does a bare await fetch('https://www.baidu.com', …) with no AbortSignal, so it is unbounded. On networks that blackhole rather than reset — corporate proxies, some VPNs, captive portals — that hangs until the browser's own network timeout, and this view shows a skeleton the whole time with no error and no retry. Those users previously got a usable form immediately. Same story for a rejection: await isInChina() has no .catch, so a throw pins the skeleton permanently.
As written, this trades a ≤2 s flash for the gated population against an indefinite sign-up block for a population the policy doesn't target. Bounding the wait and failing open fixes both.
Please also cover the local sign-up dialog
src/components/dialog/content/SignInContent.vue:234-236 has the identical construction — ref(false) plus onMounted(async () => { userIsInChina.value = await isInChina() }), gating <SignUpForm v-else> at line 37. That's the dialog dialogService opens, i.e. the sign-up surface in local/OSS ComfyUI, and it carries the same submit race this PR is fixing. Leaving it means the leak is closed on one sign-up surface and open on the other.
Worth extracting the pending-aware detection into a small composable — useRegionGate() returning boolean | undefined with the timeout and fail-open behaviour baked in — and consuming it from both views, rather than duplicating the tri-state and its guards.
Tests
- Please drop the
readFilesource assertion (inline). isInChinaitself has no test file anywhere in the repo. The new cases pin this view'sv-ifbranches against a stubbedSignUpForm, which is fine as far as it goes, but the detector — the part actually producing wrong answers, and now load-bearing for a blocking UI state — stays uncovered.
Suggestion: replace the heuristic rather than harden around it
Not blocking, but it bears on how much timeout-tuning is worth doing here. The current detector is unsound in both directions: a VPN user in mainland China reaches Google and is waved through, while a zh-CN user anywhere in the world is hard-blocked whenever Google is briefly unreachable, via the isChineseLocale fallback. It also pings google.com and baidu.com with the user's IP from the page whose stated purpose is minimizing data exposure.
cloud.comfy.org sits behind Cloudflare, so the client country is already resolved at the edge. GET https://cloud.comfy.org/cdn-cgi/trace returns loc=<country> and sends access-control-allow-origin: * — I verified both — which means it also works cross-origin from local ComfyUI on 127.0.0.1, and that is what makes it viable for both surfaces rather than just the cloud one. One request, edge latency, deterministic geo-IP, no third-party calls. /cdn-cgi/trace is a Cloudflare implementation detail rather than a contract, so the durable form is an endpoint we own echoing CF-IPCountry with CORS, but the mechanism is proven today.
Two caveats:
isInChina()is also used byapps/desktop-ui/src/components/install/InstallLocationPicker.vue, where a wrong answer only costs a slow mirror. Don't regress that. The shape that serves both isgetClientCountry(): Promise<string | undefined>sourced from the edge, keeping the present heuristic as a fallback, with each caller choosing its own tolerance.- Whatever the client does, a client-side gate is one devtools edit from bypassed. If this rule is genuinely about data controllership rather than UX, the sign-up endpoint has to reject on the same signal. Once it does, the front-end check is courtesy and races in it stop being compliance-relevant — which is the cheaper place to end up than iterating on probe timeouts.
isInChina bounds only its Google leg; the Baidu fallback awaits a bare fetch with no AbortSignal, so on networks that blackhole rather than reset it hangs until the browser's own network timeout. Withholding the form on undefined turned that into an indefinitely blank email tab for exactly those users, who previously got a usable form. Race the probe against a 1500ms fail-open fallback and catch rejections, so the pending state always has a guaranteed exit. Also drops the source-text assertion on CloudLoginView: it asserted on file contents rather than behaviour, and its relative path resolved against vitest's cwd. The rendered-form assertion above it already covers the claim.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/platform/cloud/onboarding/CloudSignupView.test.ts`:
- Around line 157-176: Add a rejection-path test alongside the existing region
detection tests in CloudSignupView, making the inChina detector reject before
selecting “Use email instead,” then verify the email sign-up form renders. Keep
the existing pending/timeout coverage unchanged and ensure fake timers are
cleaned up consistently.
In `@src/platform/cloud/onboarding/CloudSignupView.vue`:
- Around line 152-160: Update the region-check logic in CloudSignupView to
create an AbortController, pass its signal to isInChina(), and store the timeout
handle instead of leaving it inside Promise.race. Register onUnmounted cleanup
to abort the pending check, clear the timeout, and prevent the post-await
userIsInChina assignment after unmount.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: dac0beee-b626-4d89-b5b0-3fbd0bca114a
📒 Files selected for processing (3)
src/platform/cloud/onboarding/CloudLoginView.test.tssrc/platform/cloud/onboarding/CloudSignupView.test.tssrc/platform/cloud/onboarding/CloudSignupView.vue
💤 Files with no reviewable changes (1)
- src/platform/cloud/onboarding/CloudLoginView.test.ts
… probe The email sign-up gate withheld the form behind an async China check that had no guaranteed exit, and the detector behind it was unsound. A caller-side 1500ms fallback made it worse: it fired before the probe's own 2000ms Google leg could answer, so a real "in China" verdict was silently overridden with "allowed" -- the exact leak the gate exists to close. Prefer the client country from the CDN edge, which returns a geo-IP answer cross-origin in one request and drops the google.com/baidu.com pings from the common path. Those pings leaked the user's IP to third parties from the very page whose purpose is minimizing data exposure. The reachability heuristic survives only as a fallback for when the edge cannot answer, so the desktop installer's mirror choice keeps working. Every leg is now bounded by a deadline the code owns rather than an abort signal alone, since a request the browser never settles would otherwise hang forever. The two durations are the pre-existing 2000ms and 150ms values, named rather than retuned; no new timeout was invented. Extract useRegionGate so the pending/blocked/allowed tri-state lives in one place with fail-open behaviour baked in, and consume it from both sign-up surfaces. SignInContent carried an identical submit race behind ref(false), so the leak was only ever closed on the cloud view. Policy shape is unchanged: email sign-up blocked in CN, OAuth allowed, login ungated, and the region copy is byte-identical pending legal review.
The CDN trace call was a new client-side dependency on an endpoint Cloudflare documents as an implementation detail, and it cannot be verified from inside the region it targets. A client check is bypassable regardless, so its only honest job is the UX hint the heuristic already provides. What the pending state needed was a guaranteed exit, and that comes from bounding every probe leg — two of which had no deadline at all.
Restores getClientCountry. The heuristic is unsound both ways — a VPN user in China reaches Google and is waved through, a zh-CN user anywhere is blocked whenever Google is briefly unreachable — and it pings google.com and baidu.com with the user's IP from the page whose purpose is minimizing data exposure. The edge answer is deterministic geo-IP in one bounded request. The heuristic stays as the fallback when the edge cannot answer, so the desktop mirror picker keeps its current tolerance.
🌐 Website E2ETip All tests passed.
|
|
Took the edge suggestion — On So this is deliberately the interim shape, not the destination. It degrades safely: a changed or missing Your last point is the one that actually decides this, and I agree with it. I checked the backend: there is no country check on the sign-up path today, so the entire control is client-side and one devtools edit from bypassed. That is where the compliance-relevant control belongs. What this PR fixes is narrower and still worth having: the form was interactive during detection, so someone could submit inside the window. It is a UX gate now, and an honest one — the code says so. Raising the server-side check separately since it is a different repo and a policy call rather than a frontend one. |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/shared-frontend-utils/src/networkUtil.ts`:
- Around line 25-31: Update parseTraceCountry in
packages/shared-frontend-utils/src/networkUtil.ts:25-31 to return undefined when
the parsed country is the Cloudflare sentinel XX or T1, while preserving normal
country parsing. Keep the fallback behavior in isInChina at
packages/shared-frontend-utils/src/networkUtil.ts:103-107, and add regression
tests in packages/shared-frontend-utils/src/networkUtil.test.ts:38-53 covering
both sentinels and their fallback path.
In `@src/components/dialog/content/SignInContent.test.ts`:
- Around line 115-128: Update the test “withholds the sign-up form while region
detection is pending” to assert the Google and GitHub social sign-up buttons are
present while region-check-pending is visible, while retaining the assertion
that the email signup-form is absent.
In `@src/composables/auth/useRegionGate.test.ts`:
- Around line 54-70: Move the vi.useRealTimers() cleanup from the test body into
the suite’s afterEach hook so it runs even when assertions in “waits for a slow
blocked answer rather than pre-empting it” fail. Remove the in-test cleanup
while preserving the existing fake-timer setup and test behavior.
In `@src/platform/cloud/onboarding/CloudSignupView.test.ts`:
- Around line 176-198: Replace the permanent-pending assertion in
src/platform/cloud/onboarding/CloudSignupView.test.ts lines 176-198 with a
fake-timer timeout-path test that allows the probe deadline to reject and
verifies SignUpForm renders. Apply the same change in
src/components/dialog/content/SignInContent.test.ts lines 169-190, using fake
timers for the probe deadline; both tests should confirm timeout/failure
releases the email sign-up form rather than remaining pending.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 178e4899-0e7d-41f3-ab25-ce24345d9a37
📒 Files selected for processing (8)
packages/shared-frontend-utils/src/networkUtil.test.tspackages/shared-frontend-utils/src/networkUtil.tssrc/components/dialog/content/SignInContent.test.tssrc/components/dialog/content/SignInContent.vuesrc/composables/auth/useRegionGate.test.tssrc/composables/auth/useRegionGate.tssrc/platform/cloud/onboarding/CloudSignupView.test.tssrc/platform/cloud/onboarding/CloudSignupView.vue
The edge answers XX when it cannot place the client and T1 for Tor exit nodes. Neither names a location, so returning them as-is skipped the heuristic and waved those clients through as not-in-China. Also asserts social sign-up survives the pending window in the dialog, and restores real timers in afterEach so a failed assertion cannot leak fake timers into later tests.
christian-byrne
left a comment
There was a problem hiding this comment.
Verified at 129bb2b against a local checkout, and ran the five affected suites: 44 passed.
Everything raised is addressed, and in a couple of places improved on what I suggested.
You were right to reject the call-site Promise.race I proposed. Racing a fail-open timeout against detection decides allowed while a real blocked answer is still in flight, which punches a hole in the gate it is supposed to protect. Bounding each leg inside fetchWithin is the correct shape, and the comment on useRegionGate saying so is worth keeping.
fetchWithin rejecting on an independent deadline instead of relying on the abort signal alone is the right call too. The neverSettles helper that ignores the abort signal is exactly the blackhole case that made the original version unbounded, and "settles even when every probe hangs forever" pins it. Good tests.
Two non-blocking notes, neither worth holding this.
note (non-blocking): the ceiling is now bounded but sequential, so the worst case is three legs at 2000 ms each, which the 3-call assertion in that test confirms. The part I cannot check from here: Cloudflare is throttled in mainland China, so if cloud.comfy.org/cdn-cgi/trace does not answer from inside CN, the gated population pays a 2000 ms timeout before the heuristic even starts. That would put them around 4 s of skeleton where the first version of this PR gave them 2 s, and the edge lookup would be a win for everyone except the users the gate targets. Worth one check from a CN egress. If it does time out there, running the trace and the Google probe concurrently rather than in sequence gets it back without giving up edge accuracy.
Everything else here is a clear improvement over what was there before. Approving.
fetchWithin resolved once headers arrived, so the body read ran outside the deadline and a response that stalled mid-body hung indefinitely. It now takes a read callback and races the whole exchange.
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/composables/auth/useRegionGate.ts`:
- Around line 15-18: Enforce the regional restriction in the backend
account-creation flow, specifically the createCustomer handler and POST
/customers path, using a trusted request-location source before customer
creation. Reject requests originating from the restricted region regardless of
whether they pass through useRegionGate, while preserving the existing customer
creation behavior for allowed regions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3daa8b19-b713-4c0b-abf0-758e1c109ec2
📒 Files selected for processing (9)
packages/shared-frontend-utils/src/networkUtil.test.tspackages/shared-frontend-utils/src/networkUtil.tssrc/components/dialog/content/SignInContent.test.tssrc/components/dialog/content/SignInContent.vuesrc/composables/auth/useRegionGate.test.tssrc/composables/auth/useRegionGate.tssrc/platform/cloud/onboarding/CloudLoginView.test.tssrc/platform/cloud/onboarding/CloudSignupView.test.tssrc/platform/cloud/onboarding/CloudSignupView.vue
Not actionable in this repo: createCustomer / POST /customers live in Comfy-Org/cloud. The finding is valid and tracked as https://github.com/Comfy-Org/cloud/issues/6801 (assigned), with the supporting evidence that no CF-IPCountry check exists there today. This PR is scoped to the client-side pending-state bug and documents itself as a UX gate, not a compliance control.
|
Followups from this review are filed and assigned, so none of it rides on the PR staying open:
Dismissed CodeRabbit's standing changes-request: the finding is correct but not implementable here, and it is tracked on the first issue above. Approved at |
Summary
The cloud sign-up email form was live and submittable for up to two seconds before the region check finished, so a user the China rule is meant to block could create the account inside that window.
Changes
What:
userIsInChinawas aref(false)resolved in a mount hook, sofalsemeant both "still checking" and "not in China" and the form rendered immediately. Region state is now a three-waypending | blocked | allowedbehinduseRegionGate(), with a skeleton holding the space until detection settles. The form cannot render early because it sits behindv-else.isInChina()now prefers Cloudflare's edge geo-IP over the reachability heuristic. The heuristic was unsound in both directions — a VPN user in China reaches Google and is waved through, azh-CNuser anywhere is blocked whenever Google is briefly unreachable — and it pinged google.com and baidu.com with the user's IP from the page whose purpose is minimizing data exposure. It stays as the fallback when the edge cannot answer, so the desktop mirror picker keeps its current tolerance.Every probe leg is now bounded; two previously had no deadline at all and could hang until the browser's own network timeout. Detection always settles, so callers need no timeout of their own.
SignInContent.vuehad the identical construction and now consumes the same composable, so the race is closed on both sign-up surfaces rather than one.Breaking: None. Email sign-up stays blocked in China, Google and GitHub stay allowed, login stays unguarded, and the user-facing copy is byte-identical.
Review Focus
The policy shape is unchanged; only the timing of the gate is. Previously the form was interactive during detection, which under a data-controllership rule is a real hole rather than a cosmetic flash.
Two constants carry over from the old code rather than being retuned:
PROBE_TIMEOUT_MS(2000, previously the Google leg's race) andCHINA_LATENCY_MS(150). No new timeout was introduced, and the composable and both views contain no timers — a caller-side deadline would decide "allowed" while a real "blocked" answer was still in flight.getClientCountry()readsloc=from/cdn-cgi/trace. Cloudflare documents that path only as a troubleshooting aid, not a supported API, so the durable form is a first-party endpoint echoingCF-IPCountry. Failure returnsundefinedand falls through to the heuristic.A client-side gate is bypassable by design. See the comment below on where enforcement has to live.
Screenshots
Simulated China conditions, same moments on each branch, after choosing Use email instead.
Before — the form is live throughout detection.
300 ms
1200 ms
2800 ms — the notice finally replaces it
After — a skeleton holds the space; no email or password field exists in the DOM.
300 ms
1200 ms
2800 ms — settled to the notice
Testing
44 tests across five files, every one mutation-checked. 43 killed, 1 survivor (recorded below rather than papered over).
isInChina/getClientCountry— 17 cases, 100% branch coverage:locvalue.toUpperCase()undefinedfor non-200response.okguardundefinedfor a body with nolocundefinedfor an emptyloc|| undefined→?? undefinedundefinedforXX/T1sentinelsundefinedfor a network errorfetch; deadline never rejects; timeout 2000→4000CN→ blocked / other → allowedcountry === 'CN'→!==false; threshold 150→0true; force the locale checkRegion gate and both sign-up surfaces — 27 cases:
ref('pending')→ref('allowed').catch;.catch(() => true)v-if="false"v-else-if="false"regionStatus === 'allowed'CloudSignInForm→v-if="false"query: route.query; alter the count; force the branchOne survivor, left in place.
SignInContent > leaves sign-in ungated by regionis a real assertion — deletingSignInFormkills it, and it catches a gate that withholds sign-in while the probe is pending. What it cannot catch is a gate that revokes sign-in once the probe settles toblocked, which is what its name promises. Cause is timing: the assertion resolves on the first tick, beforeonMounted's gate flips. ItsCloudLoginViewtwin is genuinely killed, because that view has no gate wired at all.Also worth recording: renaming the locale key
signupBlockedbreaks no test, becauset/stare mocked to echo the key. The twosignup_blockedtests still pin real branch routing (killed three ways), but locale-key existence is not covered on this branch.auth/popup-blockedis covered, via the locale-derived table in #14944.The
SignInContentdialog is covered by unit assertions rather than a screenshot — driving it needs a local ComfyUI backend.