Repository navigation
fix: gate PostHog user identification on store readiness - #18690
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1946 passed, 0 failed · 1 flaky📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-24T05:14:30.530Z",
"gitSha": "19e0682a42e3fe600b3459b35d7168a41fd04909",
"branch": "fix/agent-flag-race-store-readiness",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2056.2459999999874,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.19,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 507.633,
"heapDeltaBytes": -8417780,
"heapUsedBytes": 62526876,
"domNodes": -280,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.288,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2014.458999999988,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 499.7780000000001,
"heapDeltaBytes": -11371884,
"heapUsedBytes": 58979080,
"domNodes": -281,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 8.511999999999999,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1874.3819999999687,
"styleRecalcs": 77,
"styleRecalcDurationMs": 28.162,
"layouts": 14,
"layoutDurationMs": 4.276999999999999,
"taskDurationMs": 886.8770000000001,
"heapDeltaBytes": 629820,
"heapUsedBytes": 71159032,
"domNodes": -281,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 146.483,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1892.1900000000278,
"styleRecalcs": 80,
"styleRecalcDurationMs": 30.778000000000002,
"layouts": 14,
"layoutDurationMs": 4.4559999999999995,
"taskDurationMs": 834.9179999999999,
"heapDeltaBytes": 24277988,
"heapUsedBytes": 89054832,
"domNodes": 40,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 150,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1716.637999999989,
"styleRecalcs": 31,
"styleRecalcDurationMs": 13.849,
"layouts": 6,
"layoutDurationMs": 0.9190000000000002,
"taskDurationMs": 350.831,
"heapDeltaBytes": 4623948,
"heapUsedBytes": 75900176,
"domNodes": 73,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 10.428000000000003,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1740.8269999999675,
"styleRecalcs": 31,
"styleRecalcDurationMs": 15.475999999999999,
"layouts": 6,
"layoutDurationMs": 1.034,
"taskDurationMs": 358.30400000000003,
"heapDeltaBytes": 4625084,
"heapUsedBytes": 75746868,
"domNodes": 76,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 11.157,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 816.0990000000083,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.335999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 535.891,
"heapDeltaBytes": 18673136,
"heapUsedBytes": 88013420,
"domNodes": 12,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 183.54,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 677.4909999999181,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.654000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 465.72200000000004,
"heapDeltaBytes": -8140860,
"heapUsedBytes": 63083184,
"domNodes": 20,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 158.692,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2046.116999999981,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.2249999999999988,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 599.394,
"heapDeltaBytes": 9653072,
"heapUsedBytes": 86303756,
"domNodes": -276,
"jsHeapTotalBytes": -2199552,
"scriptDurationMs": 40.714,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2044.2679999999882,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.852,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 640.502,
"heapDeltaBytes": 6275868,
"heapUsedBytes": 82266184,
"domNodes": -277,
"jsHeapTotalBytes": -1413120,
"scriptDurationMs": 34.18,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2358.498999999995,
"styleRecalcs": 68,
"styleRecalcDurationMs": 12.836,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1705.1960000000001,
"heapDeltaBytes": 7693076,
"heapUsedBytes": 85423044,
"domNodes": -249,
"jsHeapTotalBytes": -663552,
"scriptDurationMs": 860.442,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2293.0559999999787,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.195999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1598.9759999999997,
"heapDeltaBytes": 22056864,
"heapUsedBytes": 88137232,
"domNodes": -273,
"jsHeapTotalBytes": 1536000,
"scriptDurationMs": 766.984,
"eventListeners": -162,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3615.3659999999945,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.970999999999997,
"layouts": 60,
"layoutDurationMs": 12.106,
"taskDurationMs": 1696.906,
"heapDeltaBytes": 10241580,
"heapUsedBytes": 77336784,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 752.652,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3604.0990000000193,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.562000000000005,
"layouts": 60,
"layoutDurationMs": 11.795999999999998,
"taskDurationMs": 1716.5749999999998,
"heapDeltaBytes": -3614204,
"heapUsedBytes": 75786276,
"domNodes": -294,
"jsHeapTotalBytes": -2461696,
"scriptDurationMs": 739.634,
"eventListeners": -190,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3085.933999999952,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.671999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1892.4659999999997,
"heapDeltaBytes": 25541168,
"heapUsedBytes": 94048168,
"domNodes": 0,
"jsHeapTotalBytes": 679936,
"scriptDurationMs": 909.135,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3103.666999999973,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.926,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1920.1370000000002,
"heapDeltaBytes": 26056016,
"heapUsedBytes": 94454396,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 925.8420000000001,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2021.7190000000187,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.414999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 553.0609999999999,
"heapDeltaBytes": 21852988,
"heapUsedBytes": 87849940,
"domNodes": -272,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 29.472000000000012,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2040.7109999999875,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.9120000000000013,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 604.3040000000001,
"heapDeltaBytes": 8312900,
"heapUsedBytes": 86957240,
"domNodes": -276,
"jsHeapTotalBytes": -1413120,
"scriptDurationMs": 34.897,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 608.1330000000094,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.357,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 413.59,
"heapDeltaBytes": 13860892,
"heapUsedBytes": 86418224,
"domNodes": 18,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 137.429,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 619.7700000000168,
"styleRecalcs": 48,
"styleRecalcDurationMs": 12.455,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 446.098,
"heapDeltaBytes": 14972728,
"heapUsedBytes": 88331756,
"domNodes": 22,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 145.651,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1992.322999999999,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.396,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 506.77099999999996,
"heapDeltaBytes": 7218944,
"heapUsedBytes": 80578484,
"domNodes": -293,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.341000000000001,
"eventListeners": -212,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2007.4679999999034,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.418000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 489.46,
"heapDeltaBytes": -12834368,
"heapUsedBytes": 60381212,
"domNodes": -297,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 8.785999999999998,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1736.2190000000055,
"styleRecalcs": 78,
"styleRecalcDurationMs": 27.193,
"layouts": 18,
"layoutDurationMs": 5.212,
"taskDurationMs": 864.514,
"heapDeltaBytes": -7352144,
"heapUsedBytes": 65332496,
"domNodes": -297,
"jsHeapTotalBytes": 6545408,
"scriptDurationMs": 101.05,
"eventListeners": -242,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1743.4220000000096,
"styleRecalcs": 78,
"styleRecalcDurationMs": 27.288999999999998,
"layouts": 18,
"layoutDurationMs": 4.787,
"taskDurationMs": 841.598,
"heapDeltaBytes": -137732,
"heapUsedBytes": 73245952,
"domNodes": -296,
"jsHeapTotalBytes": 6807552,
"scriptDurationMs": 100.616,
"eventListeners": -212,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.013999999975,
"styleRecalcs": 21,
"styleRecalcDurationMs": 28.700999999999997,
"layouts": 17,
"layoutDurationMs": 14.059999999999999,
"taskDurationMs": 918.428,
"heapDeltaBytes": 20095876,
"heapUsedBytes": 104278956,
"domNodes": 13751,
"jsHeapTotalBytes": 10485760,
"scriptDurationMs": 29.128,
"eventListeners": 2387,
"totalBlockingTimeMs": 126,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8242.96499999997,
"styleRecalcs": 248,
"styleRecalcDurationMs": 34.742000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5794.7660000000005,
"heapDeltaBytes": 13448584,
"heapUsedBytes": 90069512,
"domNodes": -270,
"jsHeapTotalBytes": 647168,
"scriptDurationMs": 2601.9480000000003,
"eventListeners": -178,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8419.91799999994,
"styleRecalcs": 248,
"styleRecalcDurationMs": 35.522999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5818.191000000001,
"heapDeltaBytes": 10029072,
"heapUsedBytes": 86114636,
"domNodes": -243,
"jsHeapTotalBytes": -401408,
"scriptDurationMs": 2640.974,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 15439.978999999994,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14888.666,
"heapDeltaBytes": -53920140,
"heapUsedBytes": 181685456,
"domNodes": -8068,
"jsHeapTotalBytes": -13926400,
"scriptDurationMs": 241.07899999999998,
"eventListeners": -14933,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 15732.012999999937,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14993.710000000001,
"heapDeltaBytes": -28724284,
"heapUsedBytes": 189358116,
"domNodes": -8068,
"jsHeapTotalBytes": -5795840,
"scriptDurationMs": 247.512,
"eventListeners": -14933,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 18475.925000000017,
"styleRecalcs": 143,
"styleRecalcDurationMs": 16.978999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18220.801,
"heapDeltaBytes": -25775816,
"heapUsedBytes": 192408784,
"domNodes": -8068,
"jsHeapTotalBytes": -15286272,
"scriptDurationMs": 867.559,
"eventListeners": -14927,
"totalBlockingTimeMs": 10,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 18658.70599999994,
"styleRecalcs": 141,
"styleRecalcDurationMs": 16.481999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18360.071,
"heapDeltaBytes": -50337892,
"heapUsedBytes": 179674760,
"domNodes": -8068,
"jsHeapTotalBytes": -15142912,
"scriptDurationMs": 918.6209999999999,
"eventListeners": -14931,
"totalBlockingTimeMs": 15,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 5530.320999999958,
"styleRecalcs": 20,
"styleRecalcDurationMs": 94.414,
"layouts": 20,
"layoutDurationMs": 35.21300000000001,
"taskDurationMs": 5447.812999999999,
"heapDeltaBytes": -41534180,
"heapUsedBytes": 177606540,
"domNodes": -8068,
"jsHeapTotalBytes": 12525568,
"scriptDurationMs": 93.286,
"eventListeners": -14931,
"totalBlockingTimeMs": 431,
"frameDurationMs": 17.779999999999987,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 5812.901000000011,
"styleRecalcs": 20,
"styleRecalcDurationMs": 73.45199999999996,
"layouts": 20,
"layoutDurationMs": 25.016,
"taskDurationMs": 5719.587999999999,
"heapDeltaBytes": -57161476,
"heapUsedBytes": 177492004,
"domNodes": -8068,
"jsHeapTotalBytes": 10317824,
"scriptDurationMs": 131.77700000000002,
"eventListeners": -14931,
"totalBlockingTimeMs": 312,
"frameDurationMs": 17.220000000000013,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8035.087000000032,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7737.164999999999,
"heapDeltaBytes": -1072424,
"heapUsedBytes": 186301724,
"domNodes": 0,
"jsHeapTotalBytes": -13369344,
"scriptDurationMs": 120.03599999999992,
"eventListeners": -12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7915.8350000000155,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7549.950000000001,
"heapDeltaBytes": 21578872,
"heapUsedBytes": 178290640,
"domNodes": 0,
"jsHeapTotalBytes": -4194304,
"scriptDurationMs": 121.12199999999996,
"eventListeners": -12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 485.94900000000507,
"styleRecalcs": 21,
"styleRecalcDurationMs": 23.347,
"layouts": 4,
"layoutDurationMs": 2.197,
"taskDurationMs": 130.06599999999997,
"heapDeltaBytes": 4974840,
"heapUsedBytes": 74386744,
"domNodes": 147,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.007999999999997,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "workflow-execution",
"durationMs": 100.8000000000493,
"styleRecalcs": 6,
"styleRecalcDurationMs": 11.675999999999998,
"layouts": 2,
"layoutDurationMs": 0.7669999999999999,
"taskDurationMs": 59.43999999999999,
"heapDeltaBytes": 2998624,
"heapUsedBytes": 71555640,
"domNodes": 102,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 4.6179999999999986,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E CoverageNote Shard completeness could not be verified for this run, so these totals may not be comparable with a whole merge.
Top 10 files by uncovered lines
|
|
The Generated by Claude Code |
Ports the store-readiness mechanism from main (storeReadiness.ts and its main.ts call sites) and awaits it in PostHogTelemetryProvider before resolving the current user. Without this, useCurrentUser() can race Pinia initialization, silently skipping posthog.identify() and leaving feature flags like agent-in-app-experience evaluated against a stale/anonymous identity.
88ff846 to
2e285db
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## cloud/1.54 #18690 +/- ##
=============================================
Coverage ? 83.76%
=============================================
Files ? 2111
Lines ? 125191
Branches ? 31721
=============================================
Hits ? 104861
Misses ? 20151
Partials ? 179
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ness (cloud/1.54) (#18694) STACKED — merging lands on cloud/1.54 (release branch, no owning PR), NOT main ## ELI-5 When the app starts, Mixpanel and Customer.io could try to find out "who is the current user" before the app's data stores were set up. When that happens, analytics can end up tagged to the wrong user or to no user at all. `main` already makes both providers wait until the stores are ready. This PR backports that wait to `cloud/1.54`. ## Summary Backports `main`'s `whenStoresReady()` gate to `MixpanelTelemetryProvider` and `CustomerIoTelemetryProvider` on `cloud/1.54`. It completes the follow-up flagged in #18690, which added the `storeReadiness` mechanism here and gated PostHog. ## Changes - **What**: Both provider sources are now byte-identical to `origin/main`. - **Mixpanel**: the `loaded` callback waits on `whenStoresReady()` before `useCurrentUser().onUserResolved(...)`. Failures go to `reportError` with `mixpanel_user_identification_failure`. - **Customer.io**: the dynamic-import callback is now `async` and awaits `whenStoresReady()` before assigning `this.analytics` or calling `useCurrentUser()`. The in-app-plugin registration `.catch` moves inline and now reports via `reportError` (`customerio_in_app_plugin_registration_failure`) instead of `console.error`, matching `main`. - **Tests**: - Adds one regression test per provider: with Pinia detached and `markStoresPending()`, the provider does not wire `onUserResolved` until `markStoresReady()` is called. Both tests fail against the old sources and pass with this change. - Updates the Customer.io in-app-failure test to assert `reportError` instead of `console.error`. - The existing Mixpanel identify test now uses `vi.waitFor`, because wiring is one microtask later. ## Review Focus - Customer.io: `this.analytics` is now assigned after the await. While stores are pending, `track*` calls go into the existing queue (`flushQueue()` runs after wiring), and page views stay gated on in-app registration as before. - Both files stay under `providers/cloud/` and are only constructed on cloud builds. There is no OSS/desktop behavior change and no feature flag, because this restores `main`'s existing gating. ## Residual - **Other telemetry modules on `cloud/1.54` still use stores without the gate** (swept `src/platform/telemetry`): `SentryTelemetryProvider.ts`, `SyftTelemetryProvider.ts`, `ImpactTelemetryProvider.ts`, `hostUserIdSync.ts`, `utils/getExecutionContext.ts`, `utils/getShellLayoutSnapshot.ts`. None of them are gated on `main` either (`main`'s only `whenStoresReady` callers are PostHog, Mixpanel and Customer.io), so this PR leaves them alone. Whether any of them has the same race is unverified and would need its own look, on `main` first. - **Tree-shaking not verified**: I did not run a non-cloud production build to confirm both files are tree-shaken out. This PR does not change their import sites, so it is the same as before. - **Not exercised end to end**: the change was verified only with unit tests. I did not test the startup race in a deployed cloud build. Unlike the PostHog case, this gap had no known user-facing symptom to reproduce. - **Source threads not read**: the internal chat threads that led to this follow-up were not readable from the worker environment. The work is based on the #18690 PR body and a direct comparison of `main` and `cloud/1.54`. ## Provenance - **Authored by:** agent-work loop - **Verified:** vitest `src/platform/telemetry`: 33 files, 450 passed, 0 failed. Red check: the 2 new tests plus the updated Customer.io test fail against the old sources (3 failed). `pnpm typecheck` clean. `pnpm knip` clean. eslint + oxlint + oxfmt on changed files clean. `git diff origin/main` on both provider sources is empty. - **Deviations:** none from `main`'s source. The tests keep `cloud/1.54`'s existing mock style instead of copying `main`'s test rewrite (which relies on auto-mocks this branch does not have) and add the readiness regression tests `main` lacks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
<!-- ccr-slack-attribution -->
Requested by Christian Byrne · Slack thread
Summary
Ports the store-readiness gating mechanism from
maintocloud/1.54soPostHogTelemetryProviderawaits Pinia initialization before resolving the current user, fixing a race whereagent-in-app-experience(and other feature flags) could be evaluated against a stale/anonymous cached PostHog identity.Changes
src/platform/telemetry/storeReadiness.ts(+ its unit test) verbatim frommain, callsmarkStoresPending()/markStoresReady()around Pinia init insrc/main.ts, and makesPostHogTelemetryProvider'sposthog-jsinit callbackasyncso itawait whenStoresReady()before callinguseCurrentUser().Review Focus
Before: the client can evaluate
agent-in-app-experience(and other feature flags) against a stale/anonymous cached PostHog identity whenuseCurrentUser()races Pinia initialization, becauseposthog.identify()may silently never run for that page load. This also affects any other UI that depends on stores being ready before use.After: ports the store-readiness gating mechanism from
main(storeReadiness.ts+ its twomain.tscall sites) soPostHogTelemetryProvider.tsawaits store readiness before resolving the current user and callingidentify(), matching main's already-correct behavior.Note: on
main,MixpanelTelemetryProviderandCustomerIoTelemetryProvideralso gate their user-identification onwhenStoresReady(). Oncloud/1.54those two providers still calluseCurrentUser()without that gate (the same pre-existing race, just not the one reported). Left out of this PR to keep the urgent fix minimal and reviewable — worth a fast follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_01QS4VuPMK1pq11UcoGHUuo3
Generated by Claude Code