Repository navigation
[backport cloud/1.54] fix: await in-flight unified-auth mint instead of racing it (#15184) - #19436
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎭 Playwright: ✅ 1962 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-29T21:20:06.637Z",
"gitSha": "0975b828cd3483d98d353b18b64c3b12d35d25b6",
"branch": "backport-15184-to-cloud-1.54",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2171.0729999999785,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.07,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 678.797,
"heapDeltaBytes": 12027520,
"heapUsedBytes": 82118508,
"domNodes": -279,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 12.234999999999996,
"eventListeners": -166,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2052.351000000044,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.089,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 591.572,
"heapDeltaBytes": -3815564,
"heapUsedBytes": 66604172,
"domNodes": -282,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 11.422999999999998,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1973.8300000000208,
"styleRecalcs": 80,
"styleRecalcDurationMs": 35.93399999999999,
"layouts": 14,
"layoutDurationMs": 4.9270000000000005,
"taskDurationMs": 979.943,
"heapDeltaBytes": 7270264,
"heapUsedBytes": 78664552,
"domNodes": -281,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 154.973,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1856.0410000000047,
"styleRecalcs": 75,
"styleRecalcDurationMs": 30.34,
"layouts": 14,
"layoutDurationMs": 3.7479999999999998,
"taskDurationMs": 949.696,
"heapDeltaBytes": -7707944,
"heapUsedBytes": 62791464,
"domNodes": -281,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 150.88500000000002,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1748.980999999958,
"styleRecalcs": 30,
"styleRecalcDurationMs": 24.166999999999998,
"layouts": 6,
"layoutDurationMs": 1.431,
"taskDurationMs": 419.57700000000006,
"heapDeltaBytes": 4252244,
"heapUsedBytes": 74848076,
"domNodes": 76,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 13.469000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1751.5840000000935,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.707,
"layouts": 6,
"layoutDurationMs": 1.2839999999999998,
"taskDurationMs": 426.914,
"heapDeltaBytes": 4607776,
"heapUsedBytes": 75582380,
"domNodes": 75,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 14.172999999999998,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 714.0459999999962,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.294000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.54699999999997,
"heapDeltaBytes": -7926208,
"heapUsedBytes": 63432100,
"domNodes": 14,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 156.42600000000002,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 726.222000000007,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.777,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 475.86600000000004,
"heapDeltaBytes": -7582124,
"heapUsedBytes": 63494712,
"domNodes": 20,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 158.562,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2079.359000000011,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.672999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 712.204,
"heapDeltaBytes": 11142124,
"heapUsedBytes": 86842040,
"domNodes": -269,
"jsHeapTotalBytes": -1413120,
"scriptDurationMs": 36.61599999999999,
"eventListeners": -162,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2043.8640000000987,
"styleRecalcs": 5,
"styleRecalcDurationMs": 5.339,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 705.448,
"heapDeltaBytes": 7454996,
"heapUsedBytes": 84337048,
"domNodes": -277,
"jsHeapTotalBytes": -1675264,
"scriptDurationMs": 36.372,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2759.1730000000325,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.142,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1798.9100000000003,
"heapDeltaBytes": -9865348,
"heapUsedBytes": 67653952,
"domNodes": -272,
"jsHeapTotalBytes": -2199552,
"scriptDurationMs": 842.3629999999999,
"eventListeners": -162,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2711.3389999999526,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.88,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1790.8739999999998,
"heapDeltaBytes": 8143312,
"heapUsedBytes": 85848784,
"domNodes": -250,
"jsHeapTotalBytes": 385024,
"scriptDurationMs": 839.05,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3837.416000000019,
"styleRecalcs": 60,
"styleRecalcDurationMs": 10.409000000000002,
"layouts": 60,
"layoutDurationMs": 12.622000000000002,
"taskDurationMs": 1820.8639999999998,
"heapDeltaBytes": 8219776,
"heapUsedBytes": 76313568,
"domNodes": -281,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 789.544,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3817.9249999999456,
"styleRecalcs": 63,
"styleRecalcDurationMs": 13.561999999999998,
"layouts": 60,
"layoutDurationMs": 12.940000000000001,
"taskDurationMs": 1897.187,
"heapDeltaBytes": -3223424,
"heapUsedBytes": 75059716,
"domNodes": -280,
"jsHeapTotalBytes": -888832,
"scriptDurationMs": 781.948,
"eventListeners": -158,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3190.987000000007,
"styleRecalcs": 41,
"styleRecalcDurationMs": 6.518,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2111.228,
"heapDeltaBytes": 27294044,
"heapUsedBytes": 92739156,
"domNodes": -284,
"jsHeapTotalBytes": 1728512,
"scriptDurationMs": 1016.5280000000001,
"eventListeners": -10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3133.8739999999916,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.2010000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2019.3390000000004,
"heapDeltaBytes": 778528,
"heapUsedBytes": 69011592,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 976.759,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2052.489000000037,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.0010000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 670.9090000000001,
"heapDeltaBytes": 10432416,
"heapUsedBytes": 87881556,
"domNodes": -274,
"jsHeapTotalBytes": -1413120,
"scriptDurationMs": 34.90399999999999,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2034.3010000000277,
"styleRecalcs": 4,
"styleRecalcDurationMs": 4.078000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 683.599,
"heapDeltaBytes": 10330128,
"heapUsedBytes": 88066988,
"domNodes": -275,
"jsHeapTotalBytes": -1413120,
"scriptDurationMs": 34.844,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 709.1110000000072,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.907,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 458.18500000000006,
"heapDeltaBytes": 15138104,
"heapUsedBytes": 88316056,
"domNodes": 18,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 151.892,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 699.1709999999784,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.379,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 448.349,
"heapDeltaBytes": 14997020,
"heapUsedBytes": 87351872,
"domNodes": 20,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 145.902,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2011.589000000015,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.486000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 568.047,
"heapDeltaBytes": -8197884,
"heapUsedBytes": 64513852,
"domNodes": -300,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 10.251999999999997,
"eventListeners": -240,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2024.3509999999105,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.773000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 549.3269999999999,
"heapDeltaBytes": -11547104,
"heapUsedBytes": 61597512,
"domNodes": -297,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 10.606999999999998,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1786.0499999999888,
"styleRecalcs": 77,
"styleRecalcDurationMs": 30.694,
"layouts": 18,
"layoutDurationMs": 5.752,
"taskDurationMs": 949.183,
"heapDeltaBytes": 5638412,
"heapUsedBytes": 79054268,
"domNodes": -297,
"jsHeapTotalBytes": 7069696,
"scriptDurationMs": 117.79599999999998,
"eventListeners": -212,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1755.0609999999551,
"styleRecalcs": 80,
"styleRecalcDurationMs": 31.415,
"layouts": 18,
"layoutDurationMs": 5.651000000000001,
"taskDurationMs": 931.1890000000001,
"heapDeltaBytes": -8930832,
"heapUsedBytes": 63821448,
"domNodes": -295,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 114.91199999999999,
"eventListeners": -242,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1400.0179999999887,
"styleRecalcs": 20,
"styleRecalcDurationMs": 33.556,
"layouts": 16,
"layoutDurationMs": 14.345000000000004,
"taskDurationMs": 969.6079999999998,
"heapDeltaBytes": -5144384,
"heapUsedBytes": 85509208,
"domNodes": 13831,
"jsHeapTotalBytes": 11010048,
"scriptDurationMs": 34.939,
"eventListeners": 2387,
"totalBlockingTimeMs": 143,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 9075.046999999984,
"styleRecalcs": 250,
"styleRecalcDurationMs": 39.533,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6343.687,
"heapDeltaBytes": 4231500,
"heapUsedBytes": 81096012,
"domNodes": -281,
"jsHeapTotalBytes": 647168,
"scriptDurationMs": 2731.393,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 9333.956000000057,
"styleRecalcs": 246,
"styleRecalcDurationMs": 36.032999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6359.114,
"heapDeltaBytes": 13932724,
"heapUsedBytes": 90326964,
"domNodes": -275,
"jsHeapTotalBytes": -958464,
"scriptDurationMs": 2783.327,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 15753.203999999983,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15249.109,
"heapDeltaBytes": -26644732,
"heapUsedBytes": 191909992,
"domNodes": -8068,
"jsHeapTotalBytes": -9973760,
"scriptDurationMs": 289.648,
"eventListeners": -14933,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 16241.368999999962,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15671.819,
"heapDeltaBytes": -55307032,
"heapUsedBytes": 168117032,
"domNodes": -8068,
"jsHeapTotalBytes": -13115392,
"scriptDurationMs": 247.461,
"eventListeners": -14935,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 18965.752000000008,
"styleRecalcs": 140,
"styleRecalcDurationMs": 18.82900000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18715.871,
"heapDeltaBytes": -42969332,
"heapUsedBytes": 170328768,
"domNodes": -8068,
"jsHeapTotalBytes": -9494528,
"scriptDurationMs": 877.294,
"eventListeners": -14941,
"totalBlockingTimeMs": 6,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 19222.329999999944,
"styleRecalcs": 135,
"styleRecalcDurationMs": 18.320000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18983.154,
"heapDeltaBytes": -53866124,
"heapUsedBytes": 181462540,
"domNodes": -8068,
"jsHeapTotalBytes": -15536128,
"scriptDurationMs": 913.0930000000001,
"eventListeners": -14929,
"totalBlockingTimeMs": 19,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 5662.204999999972,
"styleRecalcs": 20,
"styleRecalcDurationMs": 74.52599999999998,
"layouts": 20,
"layoutDurationMs": 25.52,
"taskDurationMs": 5594.048000000001,
"heapDeltaBytes": -65667664,
"heapUsedBytes": 174798928,
"domNodes": -8072,
"jsHeapTotalBytes": 8843264,
"scriptDurationMs": 98.88199999999999,
"eventListeners": -14931,
"totalBlockingTimeMs": 329,
"frameDurationMs": 17.779999999999987,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 5753.71599999994,
"styleRecalcs": 20,
"styleRecalcDurationMs": 79.374,
"layouts": 20,
"layoutDurationMs": 27.09700000000001,
"taskDurationMs": 5675.693,
"heapDeltaBytes": -49331412,
"heapUsedBytes": 169505420,
"domNodes": -8068,
"jsHeapTotalBytes": 9162752,
"scriptDurationMs": 139.859,
"eventListeners": -14929,
"totalBlockingTimeMs": 272,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7903.434000000005,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7662.9900000000025,
"heapDeltaBytes": 3636156,
"heapUsedBytes": 187870956,
"domNodes": 0,
"jsHeapTotalBytes": -7864320,
"scriptDurationMs": 128.73800000000003,
"eventListeners": -14,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7996.843000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7773.481000000001,
"heapDeltaBytes": -12517356,
"heapUsedBytes": 174490164,
"domNodes": 0,
"jsHeapTotalBytes": -11010048,
"scriptDurationMs": 130.923,
"eventListeners": -12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 450.1549999999952,
"styleRecalcs": 14,
"styleRecalcDurationMs": 20.334999999999997,
"layouts": 3,
"layoutDurationMs": 0.7309999999999999,
"taskDurationMs": 114.57399999999998,
"heapDeltaBytes": 4778816,
"heapUsedBytes": 73721848,
"domNodes": 124,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 7.793999999999999,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 106.58599999999296,
"styleRecalcs": 6,
"styleRecalcDurationMs": 12.933000000000002,
"layouts": 2,
"layoutDurationMs": 0.5689999999999998,
"taskDurationMs": 72.991,
"heapDeltaBytes": 3010944,
"heapUsedBytes": 72556640,
"domNodes": 104,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 5.549,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 9 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 3 |
| 🟡 Medium | 5 |
| 🟢 Low | 1 |
Panel: 8/8 reviewers contributed findings.
| if (await awaitUnifiedMint()) return null | ||
| const token = useWorkspaceAuthStore().getUnifiedToken() | ||
| if (token) return { Authorization: `Bearer ${token}` } | ||
| return await getFirebaseAuthHeader() |
There was a problem hiding this comment.
🟠 High — Falling back to the Firebase token whenever the unified token is absent is fail-open, and absence does not only mean "the login mint failed": the unified token is workspace-scoped, so after switchUnifiedWorkspace clears it mid-transition (or a revocation / permanent mint denial tears it down) this hands the server the raw user identity, which resolves to the personal workspace — requests the UI believes are scoped to team workspace X execute against the personal one. The legacy path deliberately fails closed here (ensureWorkspaceToken returns null "so callers fail closed rather than downgrade to the personal identity", and non-unified getAuthHeader has no Firebase fallback while a workspace is active). Consider gating the fallback on the current unified target being the personal workspace. Raised by 4 of 8 reviewers (claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, kimi-k3-max adversarial).
| */ | ||
| const awaitUnifiedMint = async (): Promise<boolean> => { | ||
| const uid = currentUser.value?.uid | ||
| if (uid) await mintUnifiedToken(uid).catch(() => false) |
There was a problem hiding this comment.
🟠 High — This await has no timeout or cancellation: mintAtLogin bottoms out in a bare fetch(workspaceApiUrl('/auth/token')) with no AbortSignal, and because the promise is memoized every caller for that uid joins the same hung promise. getAuthHeader is awaited by api.fetchApi before its own response-header timeout applies and by the router guard after its initialization wait, so neither existing timeout covers it — one stalled mint (hanging proxy, captive portal) wedges all cloud requests, the WebSocket handshake, and navigation for the whole session, and the intended Firebase fallback is never reached. Pass AbortSignal.timeout(...) to the mint fetch or race this await against a deadline. Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, gemini-3.1-pro adversarial, kimi-k3-max adversarial, kimi-k3-max edge-case).
| useWorkspaceAuthStore() | ||
| .mintAtLogin() | ||
| .then((success) => { | ||
| if (!success) mintUnifiedToken.delete(uid) |
There was a problem hiding this comment.
🟠 High — Evicting the memo on every failed mint removes all backoff, and awaitUnifiedMint then does not merely await an in-flight mint — with no cached entry it starts a fresh one and blocks on it. Since api.fetchApi calls getAuthHeader() for every cloud request and the router guard calls it on every navigation, a degraded or denying /auth/token gets one new failing round-trip per request, added to that request's latency; only concurrent callers coalesce via inFlightUnifiedMint, sequential ones do not. The legacy path guards exactly this with recoveryCooldownUntil/startRecoveryCooldown() — add an equivalent cooldown or bounded backoff before re-minting, and don't retry at all on permanent 401/403-class failures. Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gemini-3.1-pro adversarial, gpt-5.6-sol-max adversarial, kimi-k3-max adversarial, kimi-k3-max edge-case).
| */ | ||
| const getUnifiedAuthToken = async (): Promise<string | undefined> => { | ||
| if (await awaitUnifiedMint()) return undefined | ||
| return useWorkspaceAuthStore().getUnifiedToken() |
There was a problem hiding this comment.
🟡 Medium — getUnifiedAuthToken returns undefined on mint failure while getUnifiedAuthHeader falls back to the Firebase token for the identical condition. This getter feeds the WebSocket handshake token query param and backend node auth, so a failed mint leaves the realtime socket unauthenticated while HTTP requests still carry a working credential — the same "authenticated user reported as logged out" symptom this PR sets out to fix, left in place on the socket path. Pick one policy (fall back on both, or fail closed on both) and apply it consistently. Raised by 6 of 8 reviewers (gemini-3.1-pro adversarial, gemini-3.1-pro edge-case, claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case).
| const mintUnifiedToken = useMemoize((uid: string) => | ||
| useWorkspaceAuthStore() | ||
| .mintAtLogin() | ||
| .then((success) => { |
There was a problem hiding this comment.
🟡 Medium — The eviction lives in .then() with no rejection handler, so a rejected mint promise stays in the memoize cache for the rest of the session: awaitUnifiedMint's .catch(() => false) then resolves every later call instantly without re-minting, permanently pinning the session to the Firebase fallback, and the fire-and-forget void mintUnifiedToken(user.uid) at line 179 surfaces as an unhandled rejection. mintAtLogin swallowing its own errors makes this latent today — but that also makes awaitUnifiedMint's .catch dead code, so one of the two is wrong. Use .catch(() => { mintUnifiedToken.delete(uid); return false }). Raised by 5 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gemini-3.1-pro adversarial, gemini-3.1-pro edge-case, kimi-k3-max edge-case).
| let customerRecovery: Promise<void> | null = null | ||
| let customerRecoveryIdentity: string | null = null | ||
| const isFetchingBalance = ref(false) | ||
| const mintUnifiedToken = useMemoize((uid: string) => |
There was a problem hiding this comment.
🟡 Medium — A successful mint is memoized per-uid and only invalidated by mintUnifiedToken.clear() on sign-out or identity change, but clearWorkspaceContext()/endWorkspaceSession() wipe unifiedToken for a user who is still signed in. In that state the memo still resolves true, so awaitUnifiedMint short-circuits and mintAtLogin's own "no token, re-mint" branch never runs: getAuthToken() returns undefined and getAuthHeader() degrades to the Firebase token permanently, with no path back to a unified token short of signing out. Invalidate the memo wherever the unified token is cleared. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
| const awaitUnifiedMint = async (): Promise<boolean> => { | ||
| const uid = currentUser.value?.uid | ||
| if (uid) await mintUnifiedToken(uid).catch(() => false) | ||
| return currentUser.value?.uid !== uid |
There was a problem hiding this comment.
🟡 Medium — The staleness fence compares only the Firebase uid, but the credential being awaited is workspace-scoped and this await is a new window during which the workspace can change. A workspace switch — or an A→B→A account switch — leaves the uid equal, so the caller proceeds with the replacement workspace's token (or the Firebase fallback) for a request prepared against the previous one. Fence on the workspace/session generation rather than the uid alone. Raised by 2 of 8 reviewers (gpt-5.6-sol-max adversarial, kimi-k3-max adversarial).
| const token = useWorkspaceAuthStore().getUnifiedToken() | ||
| return token ? { Authorization: `Bearer ${token}` } : null | ||
| } | ||
| if (flags.unifiedCloudAuthEnabled) return getUnifiedAuthHeader() |
There was a problem hiding this comment.
🟡 Medium — The login-mint race is only closed on getAuthHeader/getAuthToken. getWorkspaceAuthHeader (~line 354) and getWorkspaceAuthToken (~line 406) still read useWorkspaceAuthStore().getUnifiedToken() synchronously under the same flag without calling awaitUnifiedMint(), so a workspace-scoped request issued during the login-mint window still sees undefined and getWorkspaceAuthHeaderOrThrow throws userNotAuthenticated for an authenticated user — the exact failure this PR fixes elsewhere. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
|
|
||
| if (user === null || identityChanged) { | ||
| useWorkspaceAuthStore().clearWorkspaceContext() | ||
| mintUnifiedToken.clear() |
There was a problem hiding this comment.
🟢 Low — clear() drops the cache entry but does not cancel the in-flight promise that entry held, and the eviction callback is not fenced against supersession. On sign-out then sign-in as the same uid within the mint's flight window, a fresh promise is stored under the identical [uid] key; the old promise then resolves false and its mintUnifiedToken.delete(uid) evicts the new session's entry, forcing a redundant mint. Self-healing, but capture the promise (or a generation counter) and only delete when the cached entry is still the one this callback created. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gemini-3.1-pro adversarial).
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## cloud/1.54 #19436 +/- ##
=============================================
Coverage ? 79.11%
=============================================
Files ? 2029
Lines ? 113617
Branches ? 32098
=============================================
Hits ? 89890
Misses ? 23548
Partials ? 179
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
65ee3c0 to
b28eaaa
Compare
Backport of PR #15184 (prevents auth callers from racing an in-flight unified-token mint). The target branch uses an older auth test harness, so the backport carries the production fix and a target-compatible fallback assertion. Local verification:
pnpm vitest run src/stores/__tests__/authTokenPriority.test.ts src/stores/authStore.test.ts(133 passed).