Skip to content

fix: ZIP files always use forward slashes / regardless of the operati…#616

Merged
fatelei merged 1 commit intolanggenius:mainfrom
fatelei:issue-32650
Feb 27, 2026
Merged

fix: ZIP files always use forward slashes / regardless of the operati…#616
fatelei merged 1 commit intolanggenius:mainfrom
fatelei:issue-32650

Conversation

@fatelei
Copy link
Contributor

@fatelei fatelei commented Feb 27, 2026

…ng system

Description

fix langgenius/dify#32650

Root Cause: In pkg/bundle_packager/memory_zip.go, the code used filepath.Separator (which is \ on Windows) to check for the _assets/ directory prefix in ZIP file paths. ZIP files always use forward slashes / regardless of the operating system, causing the asset detection to fail on Windows.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working Windows labels Feb 27, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 27, 2026
@fatelei fatelei merged commit 72288c3 into langgenius:main Feb 27, 2026
7 checks passed
@bingtianyiyan
Copy link

There are also issues in other places, not just in this piece of code. For example, there are problems in the decompression function below the pkg/plugin_packager/decoder/zip as well.Your point is absolutely correct! In the Dify plugin system, there is indeed a serious inconsistency issue with path handling. Because the system needs to handle both ZIP internal paths (must use forward slashes) and Windows file system paths (must use backslashes), the mixed use of path and filepath functions throughout the codebase has led to various bugs. filepath.Join does not handle \ in a way that conforms to the slash standard on Windows.

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

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When I install the model provider, an error occurs

3 participants