Skip to content

fix: handle integration marketplace install callbacks#38236

Merged
hjlarry merged 8 commits into
mainfrom
fix/install-from-market
Jul 1, 2026
Merged

fix: handle integration marketplace install callbacks#38236
hjlarry merged 8 commits into
mainfrom
fix/install-from-market

Conversation

@Jingyi-Dify

Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fix marketplace install callbacks launched from Integrations so users return to the right Integration category and the selected package is installed from the callback URL instead of being dropped by route redirects.

This PR:

  • preserves marketplace install query params when legacy /plugins URLs redirect into Integrations
  • routes install callbacks to /integrations/<category>/plugins so the category page stays mounted and can consume package-ids
  • extracts the shared marketplace install query consumer used by both the plugin page and integration category page
  • wires model provider and data source marketplace entrypoints to the same callback flow as the other Integration categories
  • avoids focusing the install dialog close button when returning from marketplace

Verification:

  • pnpm -C web test app/components/header/account-setting/model-provider-page/__tests__/install-from-marketplace.spec.tsx app/components/header/account-setting/data-source-page-new/__tests__/install-from-marketplace.spec.tsx app/components/integrations/__tests__/page.spec.tsx app/components/integrations/__tests__/plugin-category-page.spec.tsx app/components/plugins/plugin-page/__tests__/index.spec.tsx app/components/plugins/__tests__/plugin-routes.spec.ts app/components/integrations/__tests__/routes.spec.ts
  • pnpm -C web type-check
  • pnpm -C packages/dify-ui type-check
  • pnpm -C packages/dify-ui exec eslint src/dialog/index.tsx src/dialog/__tests__/index.spec.tsx
  • Not run: pnpm -C packages/dify-ui test src/dialog/__tests__/index.spec.tsx because the local Playwright Chromium cache is missing chromium_headless_shell

From Codex

Screenshots

Before After
Marketplace install callbacks could return to the wrong page, lose package-ids, or require an extra dialog focus cleanup. Marketplace install callbacks return to the matching Integration category, consume package-ids, and avoid focusing the close button.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. refactor labels Jul 1, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.58824% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.36%. Comparing base (089c3f4) to head (2b16c96).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
web/app/components/plugins/plugin-page/index.tsx 60.00% 8 Missing ⚠️
...plugin/hooks/use-install-from-marketplace-query.ts 92.15% 4 Missing ⚠️
web/app/components/plugins/plugin-routes.ts 96.82% 2 Missing ⚠️
...ovider-page/model-selector/marketplace-section.tsx 50.00% 1 Missing ⚠️
.../install-plugin/install-from-marketplace-query.tsx 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #38236      +/-   ##
==========================================
+ Coverage   85.35%   85.36%   +0.01%     
==========================================
  Files        4959     4960       +1     
  Lines      258802   259086     +284     
  Branches    49088    49187      +99     
==========================================
+ Hits       220889   221171     +282     
- Misses      33606    33608       +2     
  Partials     4307     4307              
Flag Coverage Δ
dify-ui 94.93% <ø> (ø)
web 85.06% <90.58%> (+0.03%) ⬆️

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 1, 2026
@hjlarry hjlarry added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit f816ae2 Jul 1, 2026
38 checks passed
@hjlarry hjlarry deleted the fix/install-from-market branch July 1, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:XL This PR changes 500-999 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.

2 participants