Repository navigation
fix: stop logging expected jobs-poller auth failures as errors - #14562
luke-mino-altherr wants to merge 2 commits into
Conversation
The jobs poller runs continuously and hits 401 (unauthenticated) and 403 (no access) while a session is expired or the user lacks access. These are expected states, but fetchJobsRaw logged every one via console.error, which RUM ingests as frontend errors (~129k/week, ~46% of all reported errors). Skip logging for the expected 401/403 statuses, downgrade other non-ok statuses and network failures to console.warn. Return values and control flow are unchanged.
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1782 passed, 0 failed📊 Browser Reports
📦 Bundle: 8.21 MB gzip 🔴 +26 BDetailsSummary
Category Glance App Entry Points — 3.64 kB (baseline 3.64 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.29 MB (baseline 1.29 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed / 1 unchanged Views & Navigation — 111 kB (baseline 111 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 12 added / 12 removed / 4 unchanged Panels & Settings — 551 kB (baseline 551 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 15 unchanged User & Accounts — 28.7 kB (baseline 28.7 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 3 unchanged Editors & Dialogs — 124 kB (baseline 124 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 6 added / 6 removed / 1 unchanged UI Components — 70 kB (baseline 70 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 9 unchanged Data & Services — 3.45 MB (baseline 3.45 MB) • 🔴 +346 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 386 kB (baseline 386 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 16 added / 16 removed / 20 unchanged Vendor & Third-Party — 15.7 MB (baseline 15.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 12.8 MB (baseline 12.8 MB) • ⚪ 0 BBundles that do not match a named category
Status: 70 added / 70 removed / 211 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-02T02:45:46.450Z",
"gitSha": "b523c8213b2dbdfe845d1aef58f7bea0e8d5edd9",
"branch": "fix/jobs-api-auth-log-noise",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2007.4199999999962,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.862000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 485.55499999999995,
"heapDeltaBytes": 5259212,
"heapUsedBytes": 73161556,
"domNodes": 20,
"jsHeapTotalBytes": 19787776,
"scriptDurationMs": 19.504,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2071.1560000000304,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.441000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 523.957,
"heapDeltaBytes": -21591144,
"heapUsedBytes": 46200056,
"domNodes": -280,
"jsHeapTotalBytes": 20439040,
"scriptDurationMs": 18.587,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1941.2470000000042,
"styleRecalcs": 73,
"styleRecalcDurationMs": 36.587999999999994,
"layouts": 12,
"layoutDurationMs": 3.13,
"taskDurationMs": 966.1800000000001,
"heapDeltaBytes": -14443200,
"heapUsedBytes": 53393944,
"domNodes": -280,
"jsHeapTotalBytes": 21749760,
"scriptDurationMs": 119.074,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1917.0369999999934,
"styleRecalcs": 75,
"styleRecalcDurationMs": 39.066,
"layouts": 12,
"layoutDurationMs": 3.8480000000000003,
"taskDurationMs": 949.789,
"heapDeltaBytes": -16139064,
"heapUsedBytes": 51809060,
"domNodes": -281,
"jsHeapTotalBytes": 20963328,
"scriptDurationMs": 121.03199999999998,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1744.2949999999655,
"styleRecalcs": 32,
"styleRecalcDurationMs": 18.173,
"layouts": 6,
"layoutDurationMs": 0.8029999999999999,
"taskDurationMs": 383.74199999999996,
"heapDeltaBytes": 7906684,
"heapUsedBytes": 75723556,
"domNodes": 78,
"jsHeapTotalBytes": 20312064,
"scriptDurationMs": 18.368000000000002,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.0230000000593,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.567,
"layouts": 6,
"layoutDurationMs": 0.591,
"taskDurationMs": 386.81699999999995,
"heapDeltaBytes": 7847948,
"heapUsedBytes": 75591432,
"domNodes": 78,
"jsHeapTotalBytes": 20574208,
"scriptDurationMs": 19.837,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 574.0639999999928,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.050000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 387.027,
"heapDeltaBytes": -12416764,
"heapUsedBytes": 55532696,
"domNodes": 20,
"jsHeapTotalBytes": 21622784,
"scriptDurationMs": 55.58800000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 590.5890000000227,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.2989999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 372.605,
"heapDeltaBytes": -12220580,
"heapUsedBytes": 55652840,
"domNodes": 20,
"jsHeapTotalBytes": 22147072,
"scriptDurationMs": 53.418,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2034.9430000000268,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.426999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 682.298,
"heapDeltaBytes": 7902960,
"heapUsedBytes": 67389132,
"domNodes": -281,
"jsHeapTotalBytes": 5042176,
"scriptDurationMs": 99.45200000000001,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2025.054999999952,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.848999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 676.7080000000001,
"heapDeltaBytes": 7985416,
"heapUsedBytes": 66777468,
"domNodes": -281,
"jsHeapTotalBytes": 5042176,
"scriptDurationMs": 95.92299999999999,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2189.4419999999855,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.556000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1282.373,
"heapDeltaBytes": 5735096,
"heapUsedBytes": 65505060,
"domNodes": -282,
"jsHeapTotalBytes": 5267456,
"scriptDurationMs": 412.848,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2175.982000000033,
"styleRecalcs": 69,
"styleRecalcDurationMs": 17.506000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1304.3179999999998,
"heapDeltaBytes": 6773068,
"heapUsedBytes": 69001880,
"domNodes": -281,
"jsHeapTotalBytes": 5267456,
"scriptDurationMs": 431.74,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3228.430000000003,
"styleRecalcs": 65,
"styleRecalcDurationMs": 15.323999999999998,
"layouts": 60,
"layoutDurationMs": 7.614,
"taskDurationMs": 1529.582,
"heapDeltaBytes": -1107928,
"heapUsedBytes": 60452284,
"domNodes": -285,
"jsHeapTotalBytes": 7925760,
"scriptDurationMs": 503.4339999999999,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3199.284999999975,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.506000000000002,
"layouts": 60,
"layoutDurationMs": 7.529,
"taskDurationMs": 1442.11,
"heapDeltaBytes": 23893432,
"heapUsedBytes": 85406716,
"domNodes": 14,
"jsHeapTotalBytes": 8388608,
"scriptDurationMs": 489.02500000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2025.654999999972,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.7540000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 687.7660000000001,
"heapDeltaBytes": 8298292,
"heapUsedBytes": 70466452,
"domNodes": -279,
"jsHeapTotalBytes": 5042176,
"scriptDurationMs": 97.25999999999999,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2038.4189999999762,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.821000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 691.4549999999999,
"heapDeltaBytes": 7888112,
"heapUsedBytes": 68262804,
"domNodes": -282,
"jsHeapTotalBytes": 4780032,
"scriptDurationMs": 99.094,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 628.1189999999697,
"styleRecalcs": 45,
"styleRecalcDurationMs": 9.464000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 406.889,
"heapDeltaBytes": -10720000,
"heapUsedBytes": 57199308,
"domNodes": 16,
"jsHeapTotalBytes": 21360640,
"scriptDurationMs": 117.72699999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 596.6569999999365,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.387999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 397.72999999999996,
"heapDeltaBytes": -11864476,
"heapUsedBytes": 56228456,
"domNodes": 22,
"jsHeapTotalBytes": 22147072,
"scriptDurationMs": 114.571,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2006.6360000000145,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.298000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 519.165,
"heapDeltaBytes": 4497000,
"heapUsedBytes": 72359820,
"domNodes": 20,
"jsHeapTotalBytes": 21360640,
"scriptDurationMs": 14.71,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2004.899000000023,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.5200000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 486.20699999999994,
"heapDeltaBytes": -22254180,
"heapUsedBytes": 45761168,
"domNodes": 20,
"jsHeapTotalBytes": 19914752,
"scriptDurationMs": 13.676999999999998,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1679.3659999999875,
"styleRecalcs": 77,
"styleRecalcDurationMs": 34.872,
"layouts": 16,
"layoutDurationMs": 4.156,
"taskDurationMs": 778.6919999999999,
"heapDeltaBytes": -4815544,
"heapUsedBytes": 63229736,
"domNodes": 65,
"jsHeapTotalBytes": 20836352,
"scriptDurationMs": 82.271,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1716.4509999999495,
"styleRecalcs": 76,
"styleRecalcDurationMs": 39.269999999999996,
"layouts": 16,
"layoutDurationMs": 5.0680000000000005,
"taskDurationMs": 842.574,
"heapDeltaBytes": -21176232,
"heapUsedBytes": 46924712,
"domNodes": -279,
"jsHeapTotalBytes": 20176896,
"scriptDurationMs": 88.938,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.1670000000436,
"styleRecalcs": 19,
"styleRecalcDurationMs": 27.043000000000003,
"layouts": 15,
"layoutDurationMs": 11.280000000000001,
"taskDurationMs": 928.1949999999999,
"heapDeltaBytes": 31021716,
"heapUsedBytes": 99370948,
"domNodes": 13673,
"jsHeapTotalBytes": 16252928,
"scriptDurationMs": 43.77400000000001,
"eventListeners": 2371,
"totalBlockingTimeMs": 133,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8189.732000000049,
"styleRecalcs": 249,
"styleRecalcDurationMs": 37.635000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4490.016,
"heapDeltaBytes": 11291204,
"heapUsedBytes": 70005112,
"domNodes": -282,
"jsHeapTotalBytes": 6316032,
"scriptDurationMs": 1331.231,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8246.90800000002,
"styleRecalcs": 250,
"styleRecalcDurationMs": 37.181000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4515.558999999999,
"heapDeltaBytes": 12995920,
"heapUsedBytes": 71706496,
"domNodes": -282,
"jsHeapTotalBytes": 7102464,
"scriptDurationMs": 1322.8419999999999,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 15511.807000000033,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15465.459,
"heapDeltaBytes": -58553748,
"heapUsedBytes": 167109712,
"domNodes": -8312,
"jsHeapTotalBytes": -10428416,
"scriptDurationMs": 571.835,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 15530.853999999978,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15509.233999999999,
"heapDeltaBytes": -46312904,
"heapUsedBytes": 167673000,
"domNodes": -8312,
"jsHeapTotalBytes": -12787712,
"scriptDurationMs": 558.01,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 18607.170999999995,
"styleRecalcs": 127,
"styleRecalcDurationMs": 16.203000000000024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18558.297,
"heapDeltaBytes": -30860776,
"heapUsedBytes": 177595408,
"domNodes": -8312,
"jsHeapTotalBytes": -15740928,
"scriptDurationMs": 877.0499999999998,
"eventListeners": -16385,
"totalBlockingTimeMs": 98,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 18343.02200000002,
"styleRecalcs": 123,
"styleRecalcDurationMs": 15.260999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18303.992000000002,
"heapDeltaBytes": -20922044,
"heapUsedBytes": 177636756,
"domNodes": -8312,
"jsHeapTotalBytes": -11022336,
"scriptDurationMs": 817.633,
"eventListeners": -16385,
"totalBlockingTimeMs": 77,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 114.59500000000844,
"styleRecalcs": 7,
"styleRecalcDurationMs": 15.130999999999998,
"layouts": 2,
"layoutDurationMs": 0.626,
"taskDurationMs": 92.316,
"heapDeltaBytes": 3074004,
"heapUsedBytes": 70074196,
"domNodes": 111,
"jsHeapTotalBytes": 2883584,
"scriptDurationMs": 6.363,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 479.3490000000702,
"styleRecalcs": 19,
"styleRecalcDurationMs": 19.222,
"layouts": 2,
"layoutDurationMs": 0.9029999999999999,
"taskDurationMs": 117.202,
"heapDeltaBytes": -15886564,
"heapUsedBytes": 51132408,
"domNodes": 143,
"jsHeapTotalBytes": 7729152,
"scriptDurationMs": 9.25,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
}
]
} |
📝 WalkthroughWalkthroughChangesJob fetch logging
Estimated code review effort: 2 (Simple) | ~10 minutes 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)
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 157-169: Expand the fetchHistory tests around the existing 401/403
cases to spy on console.warn and assert those authentication responses produce
no warning or error. Update the rejected-fetch test to assert the expected
warning, then add a 500-response test that expects an empty result, one warning,
and no console.error call; preserve the existing return-value assertions.
In `@src/platform/remote/comfyui/jobs/fetchJobs.ts`:
- Line 73: Update the job-fetching flow around the try block in fetchJobs so
network request failures remain handled separately from response-contract
failures. Move res.json() and zJobsListResponse.parse(...) into
response-processing logic that logs malformed or invalid 200 responses with
console.error, while preserving the existing network-error handling; add a test
for a malformed 200 response that asserts console.error is called.
🪄 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: 1ba310da-2ead-4654-a7e5-4c404ac49ef7
📒 Files selected for processing (2)
src/platform/remote/comfyui/jobs/fetchJobs.test.tssrc/platform/remote/comfyui/jobs/fetchJobs.ts
| it.for([401, 403])( | ||
| 'does not log expected auth status %i as an error', | ||
| async (status) => { | ||
| const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) | ||
| const mockFetch = vi.fn().mockResolvedValue({ ok: false, status }) | ||
|
|
||
| const result = await fetchHistory(mockFetch) | ||
|
|
||
| expect(result).toEqual([]) | ||
| expect(errorSpy).not.toHaveBeenCalled() | ||
| errorSpy.mockRestore() | ||
| } | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert the new warning and silence contracts.
The tests only assert that console.error is not called.
- The 401/403 case can pass if the implementation logs
console.warn.
Expected authentication failures must produce no warning. - The network case can pass if the implementation logs nothing.
It also leaves the expected warning in test output. - No test covers a non-401/403 response, so the new warning branch is untested.
Spy on console.warn. Assert no warning for 401/403. Assert the expected
warning for a rejected fetch. Add a 500 response test that asserts a warning,
no error, and an empty result.
Suggested assertions
+ const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {})
const mockFetch = vi.fn().mockResolvedValue({ ok: false, status })
const result = await fetchHistory(mockFetch)
expect(result).toEqual([])
expect(errorSpy).not.toHaveBeenCalled()
+ expect(warnSpy).not.toHaveBeenCalled()
+ warnSpy.mockRestore()
...
+ const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {})
...
expect(result).toEqual([])
expect(errorSpy).not.toHaveBeenCalled()
+ expect(warnSpy).toHaveBeenCalledWith(
+ '[Jobs API] Error fetching jobs:',
+ expect.any(TypeError)
+ )
+ warnSpy.mockRestore()As per path instructions: “Tests for the fetchJobs behavior should be
behavioral, covering changed authentication, non-OK, network-error,
return-value, and logging cases ... and assert both returned results and
expected console calls.”
Also applies to: 171-182
🤖 Prompt for 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.
In `@src/platform/remote/comfyui/jobs/fetchJobs.test.ts` around lines 157 - 169,
Expand the fetchHistory tests around the existing 401/403 cases to spy on
console.warn and assert those authentication responses produce no warning or
error. Update the rejected-fetch test to assert the expected warning, then add a
500-response test that expects an empty result, one warning, and no
console.error call; preserve the existing return-value assertions.
Source: Path instructions
| } | ||
| } catch (error) { | ||
| console.error('[Jobs API] Error fetching jobs:', error) | ||
| console.warn('[Jobs API] Error fetching jobs:', error) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 4 \
'res\.json\(\)|zJobsListResponse\.parse|catch \(error\)|console\.(error|warn)' \
src/platform/remote/comfyui/jobs/fetchJobs.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 1762
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- fetchJobs.ts ---'
sed -n '1,95p' src/platform/remote/comfyui/jobs/fetchJobs.ts
printf '%s\n' '--- related tests ---'
fd -i 'fetchJobs|jobs' . | head -80
printf '%s\n' '--- current diff for target file ---'
git diff -- src/platform/remote/comfyui/jobs/fetchJobs.ts
git diff HEAD^ -- src/platform/remote/comfyui/jobs/fetchJobs.ts 2>/dev/null || true
printf '%s\n' '--- relevant test references ---'
rg -n -C 3 \
'fetchJobs|zJobsListResponse|Failed to fetch jobs|Error fetching jobs|jobs API' \
--glob '*.{test,spec}.{ts,tsx,js,jsx}' \
--glob '!node_modules' .Repository: Comfy-Org/ComfyUI_frontend
Length of output: 12529
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- fetchJobs.test.ts ---'
sed -n '1,230p' src/platform/remote/comfyui/jobs/fetchJobs.test.ts
printf '%s\n' '--- commit context ---'
git show -s --format='%h%n%s%n%b' HEAD
git diff --stat HEAD^ 2>/dev/null || true
printf '%s\n' '--- logging assertions and malformed-response fixtures ---'
rg -n -C 4 \
'console\.(error|warn)|mockRejectedValue|json:|status:|res\.ok|invalid|malformed|schema' \
src/platform/remote/comfyui/jobs/fetchJobs.test.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 13206
Keep response-contract failures at console.error. res.json() and zJobsListResponse.parse(...) are inside the same try block as the network request. Separate response parsing from network-error handling, and add a malformed-200 response test that asserts console.error.
🤖 Prompt for 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.
In `@src/platform/remote/comfyui/jobs/fetchJobs.ts` at line 73, Update the
job-fetching flow around the try block in fetchJobs so network request failures
remain handled separately from response-contract failures. Move res.json() and
zJobsListResponse.parse(...) into response-processing logic that logs malformed
or invalid 200 responses with console.error, while preserving the existing
network-error handling; add a test for a malformed 200 response that asserts
console.error is called.
Separate 401 vs 403 into distinct warn logs carrying the backend error detail (e.g. 'workspace membership not found' vs email verification), so the failure cause is diagnosable without polluting RUM error counts.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #14562 +/- ##
==========================================
- Coverage 78.14% 78.10% -0.04%
==========================================
Files 1768 1768
Lines 105794 105925 +131
Branches 32899 32397 -502
==========================================
+ Hits 82669 82736 +67
- Misses 22659 22718 +59
- Partials 466 471 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
In the description it mentions that we have some per-error-code breakdowns of expected errors, but the actual change to the handler is not branching on the error codes (it just changes everything to warn). Isn't a 401/403 on /jobs a legitimate case for errors? If not, or what is happening here from user POV?
|
Closing in favor of a root-cause fix: #14568. Per the Datadog investigation, this isn't a logging-severity problem — it's a client-side retry storm. The poller re-fetches #14568 adds an exponential circuit breaker keyed on consecutive auth failures: it logs the failure (with backend detail) once per episode and then suppresses the storm, clearing instantly on the next success. Keeps the |
Summary
The jobs poller logs
console.erroron any non-ok response, and Datadog RUM ingestsconsole.erroras an error. Expected auth states (401/403) during polling therefore flood RUM — ~123k errors/week, ~46% of all frontend RUM errors.Backend context:
/jobsis served on the ingestProtected(requireEmailVerified)group, so 401 = missing/expired token or unresolvable workspace/membership, and 403 = authenticated but email-not-verified (or account pending deletion) — not a token problem.Changes
fetchJobsRaw, downgrade non-ok responses fromconsole.errortoconsole.warn(RUM does not collectwarn), and log each failure with its status and the backend error detail extracted from the response body (e.g.workspace membership not foundvs the email-verification message). 401 and 403 now produce distinct, diagnosable log lines. Network failures also downgraded towarn. Control flow and return values unchanged.Review Focus
This is a noise-reduction + diagnosability stopgap. The real fixes (gate polling on email-verified; stop the poller / re-auth on permanent 401) are larger and tracked separately. Note: because RUM does not forward
console.warn, the extracted detail is visible in the browser console but not in Datadog RUM.