Skip to content

fix(web): move API error feedback to business flows - #45199

Draft
hyoban wants to merge 20 commits into
mainfrom
fix/web-api-error-feedback
Draft

hyoban wants to merge 20 commits into
mainfrom
fix/web-api-error-feedback

Conversation

@hyoban

@hyoban hyoban commented Oct 31, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #45150. Part of #43802.

A failed request can currently notify from both the HTTP transport and its feature handler. Move error presentation to the interaction that owns the action, while retaining token refresh, authorization recovery, and sign-in redirects.

  • Remove transport toasts and the silent option from HTTP helpers, SSE requests, and generated console-client context.
  • Add missing field, form, and section errors, retry controls, and explicit feature notifications across authentication, tools, metadata, API keys, workflow initialization, and data-source streams. Background refresh, polling, and prefetch stay quiet.
  • Keep node execution cleanup separate from error ownership, and guard stopped requests, replayed events, and stale credential streams.
  • Document the feedback contract in web/docs/toasts.md. Most changed files remove obsolete request options and update their test expectations.

Validation

  • All 124 changed unit test files passed: 2,313 tests, using vp test run --project unit --maxWorkers=2.
  • pnpm exec vp staged: passed, including the commit hook.
  • pnpm exec vp run -w check: passed.
  • Source-only Web type check with .next excluded: passed.
  • Full pnpm -C web type-check is blocked by the existing local generated .next/types/validator.ts:2368 layout-signature mismatch (MainNavLayout requires initialDetailSidebarMode). The affected layout is unchanged by this PR.
  • git diff --check: passed.

Screenshots

Not captured. Failure, recovery, and retry behavior is covered by component and hook regression tests; no browser verification was performed.

Checklist

  • This change requires an external Dify documentation update.
  • I understand that this PR may be closed without previous discussion; related discussion is linked above.
  • I've verified the change and added or updated tests for meaningful regression risks.
  • I've updated the repository documentation accordingly.
  • Ran frontend vp staged; backend checks are not applicable.

@github-actions github-actions Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web. labels Oct 31, 2026
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.68657% with 300 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.62%. Comparing base (4c521a3) to head (c0e9aee).

Files with missing lines Patch % Lines
web/app/components/tools/provider/detail.tsx 0.00% 56 Missing ⚠️
...ents/tools/setting/build-in/config-credentials.tsx 0.00% 31 Missing ⚠️
...-from-pipeline/data-source/website-crawl/index.tsx 56.75% 16 Missing ⚠️
...components/rag-pipeline/hooks/use-pipeline-init.ts 0.00% 15 Missing ⚠️
...om-pipeline/data-source/online-documents/index.tsx 64.86% 13 Missing ⚠️
.../members-page/transfer-ownership-content/index.tsx 0.00% 10 Missing ⚠️
...om/custom-web-app-brand/hooks/use-web-app-brand.ts 43.75% 9 Missing ⚠️
...page/provider-added-card/provider-card-actions.tsx 0.00% 9 Missing ⚠️
.../app/components/datasets/create/step-two/index.tsx 0.00% 8 Missing ⚠️
...vider-page/provider-added-card/model-list-item.tsx 11.11% 8 Missing ⚠️
... and 50 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #45199      +/-   ##
==========================================
- Coverage   89.85%   80.62%   -9.23%     
==========================================
  Files        6249     6249              
  Lines      398125   398659     +534     
  Branches    80223    80520     +297     
==========================================
- Hits       357737   321429   -36308     
- Misses      34078    70922   +36844     
+ Partials     6310     6308       -2     
Flag Coverage Δ
dify-ui 92.64% <ø> (ø)
web 66.64% <62.68%> (-23.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Vinext bundle analysis

JS gzip: 🟠 +9.03 KiB (+0.09%) · CSS gzip: 🟠 +104 B (+0.03%)

All client output Base gzip → Merge gzip Gzip change
JS 9869.50 KiB → 9878.53 KiB 🟠 +9.03 KiB (+0.09%)
CSS 340.28 KiB → 340.38 KiB 🟠 +104 B (+0.03%)

Entry changes: 🟠 74 increased · 🟢 8 decreased (gzip).

Largest entry changes

Top 5 by absolute gzip delta. Static dependencies overlap; do not sum entries.

Source entry Base gzip → Merge gzip Gzip change
app/components/base/amplitude/access-point-page-properties.ts 232.95 KiB → 194.42 KiB 🟢 −38.53 KiB (−16.54%)
app/components/app/in-site-message/notification.tsx 422.30 KiB → 400.75 KiB 🟢 −21.55 KiB (−5.10%)
app/components/workflow/panel/global-variable-panel/index.tsx 327.09 KiB → 310.88 KiB 🟢 −16.21 KiB (−4.96%)
app/education/expire-notice/modal.tsx 307.69 KiB → 296.63 KiB 🟢 −11.06 KiB (−3.60%)
app/components/billing/trigger-events-limit-modal/index.tsx 297.97 KiB → 287.08 KiB 🟢 −10.89 KiB (−3.65%)
Top 20 of 82 changed entries (full paths and raw sizes)
Source entry Base gzip → Merge gzip Gzip change Raw change
dynamic-entry: app/components/base/amplitude/access-point-page-properties.ts 232.95 KiB → 194.42 KiB 🟢 −38.53 KiB (−16.54%) 🟢 −103.44 KiB (−13.73%)
dynamic-entry: app/components/app/in-site-message/notification.tsx 422.30 KiB → 400.75 KiB 🟢 −21.55 KiB (−5.10%) 🟢 −61.34 KiB (−4.54%)
dynamic-entry: app/components/workflow/panel/global-variable-panel/index.tsx 327.09 KiB → 310.88 KiB 🟢 −16.21 KiB (−4.96%) 🟢 −49.53 KiB (−4.65%)
dynamic-entry: app/education/expire-notice/modal.tsx 307.69 KiB → 296.63 KiB 🟢 −11.06 KiB (−3.60%) 🟢 −33.52 KiB (−3.49%)
dynamic-entry: app/components/billing/trigger-events-limit-modal/index.tsx 297.97 KiB → 287.08 KiB 🟢 −10.89 KiB (−3.65%) 🟢 −33.26 KiB (−3.61%)
dynamic-entry: app/components/workflow/nodes/agent-v2/panel.tsx 1611.74 KiB → 1615.68 KiB 🟠 +3.94 KiB (+0.24%) 🟠 +8.92 KiB (+0.17%)
dynamic-entry: app/components/workflow/nodes/agent/panel.tsx 1456.80 KiB → 1460.72 KiB 🟠 +3.92 KiB (+0.27%) 🟠 +8.89 KiB (+0.19%)
dynamic-entry: app/components/workflow/panel/chat-variable-panel/index.tsx 1316.58 KiB → 1320.24 KiB 🟠 +3.65 KiB (+0.28%) 🟠 +7.94 KiB (+0.19%)
dynamic-entry: app/components/workflow/panel/debug-and-preview/index.tsx 1382.71 KiB → 1386.36 KiB 🟠 +3.65 KiB (+0.26%) 🟠 +7.88 KiB (+0.18%)
dynamic-entry: app/components/workflow/nodes/tool/panel.tsx 1409.06 KiB → 1412.71 KiB 🟠 +3.64 KiB (+0.26%) 🟠 +7.99 KiB (+0.17%)
dynamic-entry: app/components/workflow/nodes/trigger-plugin/panel.tsx 1407.50 KiB → 1411.15 KiB 🟠 +3.64 KiB (+0.26%) 🟠 +7.99 KiB (+0.17%)
dynamic-entry: app/components/workflow/nodes/trigger-schedule/panel.tsx 1323.33 KiB → 1326.95 KiB 🟠 +3.62 KiB (+0.27%) 🟠 +7.90 KiB (+0.19%)
dynamic-entry: app/components/workflow/header/header-in-restoring.tsx 1313.88 KiB → 1317.50 KiB 🟠 +3.61 KiB (+0.28%) 🟠 +7.93 KiB (+0.19%)
dynamic-entry: app/components/workflow/nodes/human-input/panel.tsx 1333.27 KiB → 1336.88 KiB 🟠 +3.61 KiB (+0.27%) 🟠 +7.88 KiB (+0.18%)
dynamic-entry: app/components/workflow/nodes/iteration/panel.tsx 1311.93 KiB → 1315.54 KiB 🟠 +3.61 KiB (+0.28%) 🟠 +7.88 KiB (+0.19%)
dynamic-entry: app/components/workflow/nodes/knowledge-retrieval/panel.tsx 1400.70 KiB → 1404.30 KiB 🟠 +3.61 KiB (+0.26%) 🟠 +7.89 KiB (+0.17%)
dynamic-entry: app/components/workflow/nodes/knowledge-retrieval-v2/panel.tsx 1388.72 KiB → 1392.33 KiB 🟠 +3.61 KiB (+0.26%) 🟠 +7.88 KiB (+0.17%)
dynamic-entry: app/components/workflow/nodes/start/panel.tsx 1319.50 KiB → 1323.11 KiB 🟠 +3.61 KiB (+0.27%) 🟠 +7.88 KiB (+0.19%)
dynamic-entry: app/components/workflow/nodes/parameter-extractor/panel.tsx 1321.63 KiB → 1325.24 KiB 🟠 +3.61 KiB (+0.27%) 🟠 +7.89 KiB (+0.19%)
dynamic-entry: app/components/rag-pipeline/components/panel/input-field/index.tsx 1313.17 KiB → 1316.78 KiB 🟠 +3.60 KiB (+0.27%) 🟠 +7.88 KiB (+0.19%)
📦 0 package attribution changes (uncompressed modules)

Showing 0 of 0, ordered by absolute module-size delta.

Package Base Merge Δ
No package attribution changes — — —
Measurement details and build revisions

Base: 4c521a3c0a1f60607c8a7bcf90792f34adcf18d0 · Merge: 90fdfedb3ec4ea3756598dfe5661be38b11f2a12
Vinext: 1.4.0 → 1.4.0; Rolldown: 1.2.15 → 1.2.15

Raw JS change: 🟠 +26.34 KiB (+0.08%) · Raw CSS change: 🟠 +737 B (+0.04%)

🟠 Increase · 🟢 Decrease · ⚪ Unchanged. Colors indicate direction, not a performance budget verdict. Percentages use the base size.

Entries follow only static edges in the official Rolldown chunk graph, deduplicating shared files. Dynamic entries are measured when loaded; they are not page first-load metrics. Entry totals overlap and must not be summed.
Package attribution sums module sizes reported by Rolldown, not compressed emitted bytes. Gzip totals are measured per emitted file. This is Vinext output, not Next.js/Turbopack output.
Report only: increases do not fail this check. Missing or incompatible analysis data does.

Download base/merge snapshots and official Rolldown analysis reports.

Comparison: event base SHA vs the tested merge commit at GITHUB_SHA (PR or merge queue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed web actions show duplicate error toasts

1 participant