Repository navigation
fix: back off jobs poller on permanent auth failure instead of erroring - #14568
luke-mino-altherr wants to merge 7 commits into
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1796 passed, 0 failed · 5 flaky📊 Browser Reports
📦 Bundle: 8.69 MB gzip 🔴 +1.07 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) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 569 kB (baseline 569 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 16 unchanged User & Accounts — 27 kB (baseline 27 kB) • ⚪ 0 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.5 MB (baseline 3.5 MB) • 🔴 +3.45 kBStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 549 kB (baseline 549 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 MB (baseline 14 MB) • ⚪ 0 BBundles that do not match a named category
Status: 68 added / 68 removed / 218 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-10T22:11:00.043Z",
"gitSha": "dff4260bf4eb664f67fb6a1dfecba7eb715737b4",
"branch": "fix/jobs-poller-auth-backoff",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2088.414,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.289000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 466.24699999999996,
"heapDeltaBytes": 5880556,
"heapUsedBytes": 70304788,
"domNodes": 20,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 22.209999999999997,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2000.9919999999966,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.958999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 506.17400000000004,
"heapDeltaBytes": 5850176,
"heapUsedBytes": 70161528,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 22.113000000000003,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1797.4169999999958,
"styleRecalcs": 76,
"styleRecalcDurationMs": 34.735,
"layouts": 12,
"layoutDurationMs": 2.982,
"taskDurationMs": 788.2739999999999,
"heapDeltaBytes": -12554280,
"heapUsedBytes": 51680960,
"domNodes": -279,
"jsHeapTotalBytes": 23568384,
"scriptDurationMs": 102.34899999999999,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1729.061999999999,
"styleRecalcs": 72,
"styleRecalcDurationMs": 29.020000000000003,
"layouts": 12,
"layoutDurationMs": 2.857,
"taskDurationMs": 753.7230000000001,
"heapDeltaBytes": -13629904,
"heapUsedBytes": 50789648,
"domNodes": -280,
"jsHeapTotalBytes": 24354816,
"scriptDurationMs": 99.91600000000001,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1684.29500000002,
"styleRecalcs": 31,
"styleRecalcDurationMs": 14.084,
"layouts": 6,
"layoutDurationMs": 0.5520000000000002,
"taskDurationMs": 333.611,
"heapDeltaBytes": 8246828,
"heapUsedBytes": 72629652,
"domNodes": 77,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 19.729999999999997,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1706.384000000071,
"styleRecalcs": 30,
"styleRecalcDurationMs": 15.416,
"layouts": 6,
"layoutDurationMs": 0.5580000000000002,
"taskDurationMs": 322.44700000000006,
"heapDeltaBytes": 8528984,
"heapUsedBytes": 73018152,
"domNodes": 76,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 18.776,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 538.9370000000326,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.235000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 313.121,
"heapDeltaBytes": -11548100,
"heapUsedBytes": 52856600,
"domNodes": 18,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 47.813,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 547.079999999994,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.348999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 324.403,
"heapDeltaBytes": -11180444,
"heapUsedBytes": 53164920,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 48.614,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2008.6100000000329,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.5139999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 634.5840000000001,
"heapDeltaBytes": 6703236,
"heapUsedBytes": 66312716,
"domNodes": -283,
"jsHeapTotalBytes": 3772416,
"scriptDurationMs": 101.70299999999999,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2055.7700000000523,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.577999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 734.04,
"heapDeltaBytes": 7295708,
"heapUsedBytes": 67292484,
"domNodes": -282,
"jsHeapTotalBytes": 3510272,
"scriptDurationMs": 110.19100000000002,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2142.7530000000274,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.950000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1090.116,
"heapDeltaBytes": 3643572,
"heapUsedBytes": 66698804,
"domNodes": -283,
"jsHeapTotalBytes": 3178496,
"scriptDurationMs": 348.383,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2123.7200000000485,
"styleRecalcs": 69,
"styleRecalcDurationMs": 15.522000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1118.795,
"heapDeltaBytes": 22688488,
"heapUsedBytes": 85399840,
"domNodes": -282,
"jsHeapTotalBytes": 7110656,
"scriptDurationMs": 356.88000000000005,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3167.630000000031,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.919000000000002,
"layouts": 60,
"layoutDurationMs": 7.220000000000001,
"taskDurationMs": 1299.61,
"heapDeltaBytes": -3095440,
"heapUsedBytes": 58917220,
"domNodes": -286,
"jsHeapTotalBytes": 6131712,
"scriptDurationMs": 446.584,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3197.6110000000517,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.613999999999995,
"layouts": 60,
"layoutDurationMs": 7.813000000000001,
"taskDurationMs": 1384.5420000000001,
"heapDeltaBytes": -4853496,
"heapUsedBytes": 59919916,
"domNodes": -287,
"jsHeapTotalBytes": 6131712,
"scriptDurationMs": 474.3740000000001,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2037.448999999981,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.310000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 661.042,
"heapDeltaBytes": 6750352,
"heapUsedBytes": 67191196,
"domNodes": -283,
"jsHeapTotalBytes": 3248128,
"scriptDurationMs": 102.23599999999999,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2030.0780000000032,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.369000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 664.446,
"heapDeltaBytes": 5841968,
"heapUsedBytes": 67276200,
"domNodes": -282,
"jsHeapTotalBytes": 3248128,
"scriptDurationMs": 104.10300000000001,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 554.4879999999921,
"styleRecalcs": 47,
"styleRecalcDurationMs": 9.709999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 344.485,
"heapDeltaBytes": -10576384,
"heapUsedBytes": 53800960,
"domNodes": 20,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 104.96699999999998,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 551.9590000000107,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.487,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 362.763,
"heapDeltaBytes": -10767088,
"heapUsedBytes": 53794836,
"domNodes": 20,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 105.944,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 1998.7469999999803,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.369999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 477.566,
"heapDeltaBytes": -17468812,
"heapUsedBytes": 46897496,
"domNodes": -279,
"jsHeapTotalBytes": 23044096,
"scriptDurationMs": 17.26,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2005.2459999999996,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.936,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 466.974,
"heapDeltaBytes": -18644836,
"heapUsedBytes": 45646128,
"domNodes": 0,
"jsHeapTotalBytes": 23306240,
"scriptDurationMs": 17.459999999999997,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1683.224999999993,
"styleRecalcs": 75,
"styleRecalcDurationMs": 28.594,
"layouts": 16,
"layoutDurationMs": 3.4589999999999996,
"taskDurationMs": 676.297,
"heapDeltaBytes": -16681556,
"heapUsedBytes": 47873444,
"domNodes": -280,
"jsHeapTotalBytes": 22257664,
"scriptDurationMs": 78.791,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1692.1689999999785,
"styleRecalcs": 76,
"styleRecalcDurationMs": 32.598,
"layouts": 16,
"layoutDurationMs": 3.8729999999999998,
"taskDurationMs": 682.728,
"heapDeltaBytes": -3822064,
"heapUsedBytes": 60712424,
"domNodes": 62,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 84.35500000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1313.8480000000072,
"styleRecalcs": 19,
"styleRecalcDurationMs": 24.943,
"layouts": 15,
"layoutDurationMs": 9.724,
"taskDurationMs": 819.898,
"heapDeltaBytes": 29233468,
"heapUsedBytes": 98030844,
"domNodes": 13673,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 39.732000000000006,
"eventListeners": 2375,
"totalBlockingTimeMs": 99,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8170.974000000001,
"styleRecalcs": 249,
"styleRecalcDurationMs": 37.441,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3672.005,
"heapDeltaBytes": 7886688,
"heapUsedBytes": 67277196,
"domNodes": -282,
"jsHeapTotalBytes": 5537792,
"scriptDurationMs": 1114.963,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8152.030999999965,
"styleRecalcs": 251,
"styleRecalcDurationMs": 40.583999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3882.247,
"heapDeltaBytes": 5147520,
"heapUsedBytes": 64472868,
"domNodes": -278,
"jsHeapTotalBytes": 5275648,
"scriptDurationMs": 1127.893,
"eventListeners": -163,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 14695.426999999996,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14655.968,
"heapDeltaBytes": -14556772,
"heapUsedBytes": 183835460,
"domNodes": -8312,
"jsHeapTotalBytes": -9641984,
"scriptDurationMs": 496.5630000000001,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11700.154999999995,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11677.33,
"heapDeltaBytes": -54141660,
"heapUsedBytes": 172863188,
"domNodes": -8312,
"jsHeapTotalBytes": -4661248,
"scriptDurationMs": 495.32,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17175.860999999997,
"styleRecalcs": 119,
"styleRecalcDurationMs": 14.080999999999982,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17147.819,
"heapDeltaBytes": -52924396,
"heapUsedBytes": 177013548,
"domNodes": -8312,
"jsHeapTotalBytes": -11284480,
"scriptDurationMs": 728.6329999999999,
"eventListeners": -16387,
"totalBlockingTimeMs": 49,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17114.824999999997,
"styleRecalcs": 119,
"styleRecalcDurationMs": 14.620999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17096.727000000003,
"heapDeltaBytes": -55214332,
"heapUsedBytes": 168938272,
"domNodes": -8312,
"jsHeapTotalBytes": -10952704,
"scriptDurationMs": 764.199,
"eventListeners": -16385,
"totalBlockingTimeMs": 46,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 441.0839999999894,
"styleRecalcs": 15,
"styleRecalcDurationMs": 19.259999999999998,
"layouts": 4,
"layoutDurationMs": 1.213,
"taskDurationMs": 102.363,
"heapDeltaBytes": 5121860,
"heapUsedBytes": 68574648,
"domNodes": 126,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 10.280000000000001,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 431.8550000000414,
"styleRecalcs": 14,
"styleRecalcDurationMs": 13.234000000000002,
"layouts": 2,
"layoutDurationMs": 0.31799999999999995,
"taskDurationMs": 81.51000000000002,
"heapDeltaBytes": 5055468,
"heapUsedBytes": 68444304,
"domNodes": 125,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 7.063999999999999,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
|
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:
📝 WalkthroughWalkthroughThe change adds shared authentication backoff for ComfyUI jobs polling, connects backoff reset to authentication changes, expands failure-handling tests, and ignores local ChangesJobs polling authentication handling
Repository worktree exclusion
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant JobsPoller
participant fetchJobsRaw
participant ComfyUIJobsAPI
participant JobsAuthBackoff
participant AuthStore
JobsPoller->>fetchJobsRaw: Poll queue or history jobs
fetchJobsRaw->>JobsAuthBackoff: Check whether to skip
JobsAuthBackoff-->>fetchJobsRaw: Allow or suppress request
fetchJobsRaw->>ComfyUIJobsAPI: Request jobs
ComfyUIJobsAPI-->>fetchJobsRaw: Success or 401/403 response
fetchJobsRaw->>JobsAuthBackoff: Record result
AuthStore->>JobsAuthBackoff: Clear backoff after auth change
fetchJobsRaw-->>JobsPoller: Jobs result or empty result
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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/remote/comfyui/jobs/fetchJobs.test.ts`:
- Around line 57-106: Extend the auth-failure tests around fetchHistory to
verify both error-detail fallbacks: add a 401/403 case with a non-JSON response
body and assert the single console.error message contains the truncated raw
text, and update the empty-body recovery case to assert the log contains the
response statusText fallback. Preserve the existing backoff and recovery
assertions, and keep each test isolated by restoring or clearing shared
auth-backoff state.
In `@src/platform/remote/comfyui/jobs/fetchJobs.ts`:
- Around line 47-64: Update readErrorDetail to parse the JSON body as unknown
and validate it with a local type guard such as isErrorBody before accessing
message, error, or code. Ensure the guard confirms the value is a non-null
object and that any present fields are strings, then retain the existing
fallback order and truncated raw-text behavior for invalid shapes.
🪄 Autofix (Beta)
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: 2fab2103-bc07-4a2e-8fa4-0182196f9f54
📒 Files selected for processing (5)
.gitignoresrc/platform/remote/comfyui/jobs/fetchJobs.test.tssrc/platform/remote/comfyui/jobs/fetchJobs.tssrc/platform/remote/comfyui/jobs/jobsAuthBackoff.test.tssrc/platform/remote/comfyui/jobs/jobsAuthBackoff.ts
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #14568 +/- ##
==========================================
+ Coverage 80.76% 81.34% +0.58%
==========================================
Files 1872 1873 +1
Lines 121700 106271 -15429
Branches 37485 32725 -4760
==========================================
- Hits 98292 86449 -11843
+ Misses 22867 19467 -3400
+ Partials 541 355 -186
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 337 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ty bodies Addresses CodeRabbit review on #14568: - readErrorDetail now parses the body as unknown and narrows it with an isErrorBody type guard (rejecting non-string message/error/code) instead of an unchecked assertion on untrusted JSON. - Add auth-failure tests for a non-JSON body (logs truncated raw text) and an empty body (falls back to statusText).
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/platform/remote/comfyui/jobs/fetchJobs.test.ts`:
- Around line 87-101: Update the test “logs the raw text when an auth-failure
body is not JSON” to use a response body longer than 200 characters with a
sentinel after the 200-character boundary. Keep exercising fetchHistory with the
real response-parsing and backoff behavior, then assert the logged error
includes exactly the first 200 characters and excludes the sentinel.
🪄 Autofix (Beta)
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: 2e3288d8-84df-4cfc-899e-53a805a23c0d
📒 Files selected for processing (2)
src/platform/remote/comfyui/jobs/fetchJobs.test.tssrc/platform/remote/comfyui/jobs/fetchJobs.ts
Addresses CodeRabbit re-review on #14568: the non-JSON body test now uses a body longer than 200 chars with a sentinel past the boundary, and asserts the logged detail contains the first 200 chars and excludes the sentinel.
| `[Jobs API] Auth failure fetching jobs (${res.status}); backing off polling: ${await readErrorDetail(res)}` | ||
| ) | ||
| } | ||
| } else { |
There was a problem hiding this comment.
Reading this path as-is, after a 401/403 opens the backoff episode, a permitted probe that gets 5xx or a network error never clears it. The current-head browser proof observed 10 history refreshes producing only 4 requests—after 403 then repeated 500s, 6 calls were still suppressed—so this contradicts the PR claim that non-auth failures are unchanged and still log every time. Could we end the auth episode on any non-auth outcome and add 401/403→5xx/network transition tests? Current-head evidence
There was a problem hiding this comment.
Good catch — fixed in 8ff3744. The backoff episode now clears on any non-auth outcome, not just success.
JobsAuthBackoff gains recordNonAuthFailure() (sharing a reset closure with recordSuccess), and fetchJobsRaw calls it on both non-auth paths: the non-401/403 HTTP branch and the network-error catch. So the episode holds only while auth keeps failing — a probe that reaches a 5xx or throws ends it, and subsequent non-auth failures log every poll as before.
Added two integration tests proving the transition: 401→5xx and 403→network both resume unsuppressed polling after the probe.
huang47
left a comment
There was a problem hiding this comment.
Requesting changes until the auth-backoff transition finding is addressed. After a 401/403 opens the breaker, permitted 5xx or network-error probes do not clear it, so later non-auth failures remain suppressed; please reset the episode on non-auth outcomes and add 401/403→5xx/network transition coverage. Current-head evidence.
…ty bodies Addresses CodeRabbit review on #14568: - readErrorDetail now parses the body as unknown and narrows it with an isErrorBody type guard (rejecting non-string message/error/code) instead of an unchecked assertion on untrusted JSON. - Add auth-failure tests for a non-JSON body (logs truncated raw text) and an empty body (falls back to statusText).
Addresses CodeRabbit re-review on #14568: the non-JSON body test now uses a body longer than 200 chars with a sentinel past the boundary, and asserts the logged detail contains the first 200 chars and excludes the sentinel.
fe09399 to
8ff3744
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
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/remote/comfyui/jobs/fetchJobs.ts`:
- Around line 38-41: Wire clearJobsAuthBackoff() into the sign-in, Firebase
token refresh, and unified token refresh authentication recovery paths, using
the existing lifecycle symbols for each flow. Ensure recovery clears the backoff
before subsequent polling, and update fetchJobs.test.ts lines 122-140 to verify
that the next history or queue poll invokes fetchApi; the fetchJobs.ts anchor
requires the reset implementation, while the test site requires coverage for the
integration.
In `@src/platform/remote/comfyui/jobs/jobsAuthBackoff.test.ts`:
- Around line 19-37: Extend the test around createJobsAuthBackoff to record
consecutive authentication failures until the suppression window reaches its
maximum, then assert exactly 32 skipped calls followed by one allowed probe.
Record another failure after the probe and verify the window remains capped at
32 skips rather than widening further.
🪄 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: 4b0167cd-6740-4418-aaaa-aee6beb77ad3
📒 Files selected for processing (5)
.gitignoresrc/platform/remote/comfyui/jobs/fetchJobs.test.tssrc/platform/remote/comfyui/jobs/fetchJobs.tssrc/platform/remote/comfyui/jobs/jobsAuthBackoff.test.tssrc/platform/remote/comfyui/jobs/jobsAuthBackoff.ts
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/stores/authStore.test.ts`:
- Around line 141-147: Add a focused auth-recovery integration test in
authStore.test.ts that does not mock clearJobsAuthBackoff, while retaining only
necessary fetcher stubs. Exercise token refresh or sign-in recovery, then
trigger the next /jobs poll and assert it reaches the network, verifying the
real backoff reset behavior rather than only spying on the method.
In `@src/stores/authStore.ts`:
- Around line 223-230: Update the auth watcher around isAuthenticated and
tokenRefreshTrigger to also react to currentUser.value?.uid changes, or invoke
clearJobsAuthBackoff() from the identityChanged branch, so direct switches
between authenticated accounts reset the jobs poller backoff. Add a regression
test covering account switching without an intervening sign-out.
- Around line 20-22: Update the user identity-change handling in the auth store
to reset jobs backoff when the authenticated user ID changes, including
transitions between two authenticated users. Watch the user ID or invoke
clearJobsAuthBackoff in that identity-change path, while preserving existing
behavior for unchanged identities.
🪄 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: e17727c1-0d21-416e-8d3d-5a83f265ade0
📒 Files selected for processing (3)
src/platform/remote/comfyui/jobs/jobsAuthBackoff.test.tssrc/stores/authStore.test.tssrc/stores/authStore.ts
The jobs poller re-fetches /jobs on every WebSocket `status` frame and on a timer, but never backed off when the backend permanently rejected the session (401 = unresolved token/workspace membership, 403 = email-not-verified). A single left-open, unauthorized tab therefore fired tens of thousands of rejected /jobs requests — each logging `console.error`, which Datadog RUM ingests as an error. This one endpoint was ~46% of all frontend RUM errors (~123k/week), and per-session data showed individual sessions emitting >28k identical 401/403s over hours with zero successful polls. Root cause is a client-side retry storm, not a per-message logging severity issue. Add a counter-based circuit breaker keyed on consecutive auth failures: after the first 401/403 the poller suppresses most fetches and probes only occasionally (exponential backoff, capped), logging the failure — with the backend error detail — exactly once per failure episode. Any successful response clears the backoff instantly, so a user who verifies their email or whose workspace resolves recovers on the next probe. Non-auth failures (5xx, network) are unaffected and still log. `clearJobsAuthBackoff()` is exported so auth transitions (sign-in/out, token refresh) can reset the breaker.
Local git worktrees created under the repo root (.worktrees/*) were being scanned by knip, producing thousands of false 'unused files' failures in the pre-push hook. Mirror the existing .claude/worktrees ignore entry.
…ty bodies Addresses CodeRabbit review on #14568: - readErrorDetail now parses the body as unknown and narrows it with an isErrorBody type guard (rejecting non-string message/error/code) instead of an unchecked assertion on untrusted JSON. - Add auth-failure tests for a non-JSON body (logs truncated raw text) and an empty body (falls back to statusText).
Addresses CodeRabbit re-review on #14568: the non-JSON body test now uses a body longer than 200 chars with a sentinel past the boundary, and asserts the logged detail contains the first 200 chars and excludes the sentinel.
A 401/403 opened a backoff episode that only cleared on success. A probe that reached a 5xx or threw a network error left the episode stuck open, so later non-auth failures were suppressed instead of logging every poll. Reset the backoff on any non-auth outcome (non-401/403 HTTP error or thrown request) via recordNonAuthFailure, so the episode holds only while auth keeps failing. Add 401/403 -> 5xx and 401/403 -> network transition tests proving polling resumes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire clearJobsAuthBackoff into the auth lifecycle: a watch in authStore on [isAuthenticated, tokenRefreshTrigger] resets the jobs poller backoff on sign-in and on either token-refresh path (Firebase or unified), so recovery no longer waits out up to 32 suppressed polls. Previously the reset had no production caller and the breaker only self-healed on the next successful probe. Add a jobsAuthBackoff test for the 2^5 = 32 suppression-window cap, asserting 32 skips before a probe and that a further failure does not widen it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c026a90 to
9c7066f
Compare
Watch currentUser instead of isAuthenticated: a direct A->B account switch keeps isAuthenticated true and the new user's first token event doesn't bump tokenRefreshTrigger, so the previous watcher never cleared the shared jobs breaker for the new user. Add a switch-user test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Every reviewer in the matrix failed to contribute — see the panel summary for which cells errored, and the run logs for the underlying cause.
Panel: 0/8 reviewers contributed findings.
Reviewers that did not contribute: claude-opus-5-thinking-max:adversarial (error), gemini-3.1-pro:adversarial (error), gpt-5.6-sol-max:adversarial (error), kimi-k3-max:adversarial (error), claude-opus-5-thinking-max:edge-case (error), gemini-3.1-pro:edge-case (error), gpt-5.6-sol-max:edge-case (error), kimi-k3-max:edge-case (error)
christian-byrne
left a comment
There was a problem hiding this comment.
Credential reset coverage incomplete.
- Workspace switches still suppressed.
- Reconcile overlapping jobs-fetch PRs.
Full context for agent readers
Reviewed the exact head against current main with three independent R3 lenses. The backoff mechanics and focused CI are sound, but the reset boundary misses a credential transition used by the affected Cloud path.
PR #14561 changes jobs-fetch failures from successful empty snapshots to rejection/preserved state, while #14507 overlaps the same logging and abort paths. Please compose the breaker with those contracts during refresh rather than independently choosing land order here.
| // suppression window. Watch currentUser rather than isAuthenticated so an | ||
| // A→B account switch — where isAuthenticated stays true and the new user's | ||
| // first token event doesn't bump tokenRefreshTrigger — still clears it. | ||
| watch([currentUser, tokenRefreshTrigger], () => { |
There was a problem hiding this comment.
Workspace switches can remain suppressed.
Full context for agent readers
getAuthHeader() changes /jobs credentials when the active workspace and workspace token change, but this watcher observes only the Firebase user and tokenRefreshTrigger. Both legacy and unified workspaceAuthStore.switchWorkspace() paths mint and commit a different workspace token without changing either watched value.
Concrete sequence: workspace A returns 401 and opens the breaker → the user successfully switches to authorized workspace B → the next 2–32 queue/history calls return EMPTY_RESULT without trying B's token. Please reset the jobs backoff after a successful workspace switch and add a regression proving the next /jobs call reaches the network.
API-key replacement has the same unobserved credential-change shape; please cover it too if Cloud /jobs supports that fallback, or document why it cannot apply.
There was a problem hiding this comment.
Not changing this yet because it needs a scope decision. Resetting on workspace switch means hooking workspaceAuthStore.switchWorkspace() in both the legacy and unified paths, and the review also asks to reconcile with #14561 and #14507 (overlapping jobs-fetch paths). Questions for @christian-byrne:
- Should the workspace-switch reset land in this PR, or after fix: reject on jobs-fetch failure instead of blanking the queue #14561/fix: stop reporting handled jobs-fetch failures as errors #14507 settle the fetch contract?
- Should the reset live in
authStore(a watch on the active workspace) or insideswitchWorkspace()? - Does the Cloud
/jobsAPI-key fallback exist? If not, I'll add a note saying so rather than a reset.
Generated by Claude Code
|
Open PR Shepherd (automated): this branch now conflicts with
This also bears on the open scope question in the Generated by Claude Code |

Summary
Root-cause fix for the single largest source of frontend RUM error noise — the jobs poller's
console.erroron rejected/jobspolls (~123k errors/week, ~46% of all frontend RUM errors). Replaces the blanket error→warn downgrade in #14562.Root cause (Datadog RUM + backend)
/jobsis served on the ingestProtected(requireEmailVerified)group. The poller re-fetches/jobson every WebSocketstatusframe (viaGraphView.onStatus→queueStore.update(), two/jobscalls each) plus a timer, and never backs off when the backend permanently rejects the session:RUM shows 131k errors from just ~263 sessions (100% with no resolved user). Individual left-open, unauthorized tabs emitted >28k identical 401/403s over hours with zero successful polls. This is a client-side retry storm, not a per-message logging-severity problem — so the fix is to add backoff, not to relabel the log.
Changes
jobsAuthBackoff.ts— a counter-based circuit breaker keyed on consecutive auth failures. After the first 401/403,fetchJobsRawsuppresses most poll-driven fetches and probes only occasionally (exponential backoff, capped at 32 skipped calls between probes). The failure is logged once per episode, now including the backend error detail (workspace membership not foundvs the email-verification message). Any successful response clears the backoff instantly.console.error— a genuine auth failure is still a real signal; we fixed the volume at the source rather than hiding it. Non-auth failures (5xx, network) are unchanged and still log every time.clearJobsAuthBackoff()so auth transitions (sign-in/out, token refresh) can reset the breaker.Review Focus
/jobsreturns 200 so the breaker never trips.clearJobsAuthBackoff()on auth state changes, and gate the initial poll on auth-ready, to drop even the first-probe errors on known-ineligible sessions.Closes #14562 (supersedes the error→warn downgrade with a source fix).
Note: includes a one-line
.gitignoreentry for nested.worktrees/so the local pre-push knip hook stops choking on developer worktrees.