Skip to content

Fix deep link installation for mods containing + (plus sign)#6464

Merged
Prospector merged 7 commits into
modrinth:mainfrom
mfishma:main
Jul 21, 2026
Merged

Fix deep link installation for mods containing + (plus sign)#6464
Prospector merged 7 commits into
modrinth:mainfrom
mfishma:main

Conversation

@mfishma

@mfishma mfishma commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #6295

Summary

I was having issues where deeplinks to projects that have + in the name (like modrinth://mod/vb+) were breaking the app. It was a problem because that's the best way to have an app load an Unlisted project. The other option being the ID, but that wasn't safe to have people trust this random string of characters.

As is usually the case with "+", there was a problem with URL-encoding. The app wasn't encoding the + sign before asking the API for the mod data. So then the backend thinks the + is a space (it searches for "vb " instead of "vb+".) Since the mod with a space at the end doesn't exist, it returned nothing, and the app threw a cryptic project_type-is-null error.

Changes

  1. cache.rs Updated the URL builder to use url::form_urlencoded::byte_serialize(). This encodes the project ID (per RFC 3986) so the + actually makes it to the server correctly.
  2. content-install.ts I added a quick safety check. If a project fails to load (like if the link is a typo or missing), it now just shows a normal "Project not found" error instead of breaking the UI. And I put quotes around the ID in the error message so it's easier to spot accidental trailing spaces later.

Testing

I tested using a minimal Rust harness to verify the API responses directly:
https://api.modrinth.com/v2/projects?ids=%5B%22vb%2B%22%5D → returns all the project metadata for ViaBackwards Plus ("slug":"vb+")
https://api.modrinth.com/v2/projects?ids=%5B%22vb%2B%22%2C%22fabric-api%22%2C%22sodium%22%5D returns all the project metadata for 3 projects
https://api.modrinth.com/v2/projects?ids=["vb+"] → returns empty string []
https://api.modrinth.com/v2/projects?ids=["vb+","fabric-api","sodium"] → partial failure, still returns the last two.

Hope this helps! Let me know if you need me to change anything.

@modrinth-bot

modrinth-bot commented Jun 22, 2026

Copy link
Copy Markdown
Member

Note

This changelog has been baked. Any further edits will not be reflected.

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

  • Fixed deeplink issues for slugs containing + characters.

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@Prospector
Prospector requested a review from a team July 10, 2026 16:41
@Prospector
Prospector enabled auto-merge July 10, 2026 16:41
@Hallskii
Hallskii requested a review from fetchfern July 10, 2026 16:41
auto-merge was automatically disabled July 21, 2026 04:45

Head branch was pushed to by a user without write access

@Prospector
Prospector added this pull request to the merge queue Jul 21, 2026
Merged via the queue into modrinth:main with commit 5302e3a Jul 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Null error when opening mod ending with "+" in Windows app

4 participants