Skip to content

fix(deep-link): preserve XDG registration ownership and report failures - #3585

Merged
lucasfernog merged 16 commits into
tauri-apps:v2from
vincentkoc:fix/deep-link-xdg-command-errors
Oct 11, 2026
Merged

lucasfernog merged 16 commits into
tauri-apps:v2from
vincentkoc:fix/deep-link-xdg-command-errors

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Linux XDG registration can report success after a command fails, is_registered can mistake a substring for the app's desktop ID, and unregistering only the explicit default leaves fallback MIME associations behind.

Check command statuses through the existing I/O error variant and compare the full desktop ID. Unregister updates the owned desktop entry/cache and removes only this app's user-default and added-association entries. Preserve other schemes, handlers, ordering, and executable quoting. Explicit calls still refresh stale caches after a visible failure or missing owned file. A failed operation may leave partial state; no transactional rollback is promised.

Validation on exact signed refreshed head 89545c825d433739ac905463cb4514cee0644626, which merges frozen upstream 8882934230c903e03d56021669bc146be7a117b7:

  • Native Linux: locked all-targets build/tests and both explicitly selected --ignored --exact cases (xdg_command_results, xdg_unregister) passed.
  • Tests use the actual plugin, real XDG tools, isolated state, and executable stubs for controlled command failures. They cover exact handler identity, error propagation, fallback removal, other handlers, re-registration, and missing owned files.
  • Standalone production remains Linux-only. Separate composed source ba965506d5695149737a086596d40ab6a1a04250 combines this head with FreeBSD XDG head 4244c2e34da55dc56fb155b52bcea48ef514168f: Linux and FreeBSD each passed the three explicitly selected XDG cases. Those FreeBSD results qualify the composition, not this standalone head.

Rust and Cargo 1.98.1; Linux x86_64 and native FreeBSD 15.1 amd64. Locked resolution is unchanged before/after each job (Cargo.lock SHA-256 c72f7a8948c4a9d65d3bb0c527391587b05f93cca3f285a9aa078b975f0d326d). Original report manifests, command results, and source inventories were independently verified. These are component tests, not a GUI/session or release qualification.

FreeBSD gates remain in #3583. This does not test GUI launch or fix the generic xdg-utils quoted-Exec issue. Related proposals #3475 and #3383 change missing-tool policy; this patch retains the documented requirement and reports failures to the caller. Related: openclaw/openclaw#45233.

@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 17:57
@vincentkoc
vincentkoc requested a review from a team as a code owner September 13, 2026 17:57
…nd-errors

# Conflicts:
#	plugins/deep-link/src/lib.rs
The plugin only supports Linux, so FreeBSD builds warned about dead code.
Share the spawn, status check and logging for XDG commands.
register and unregister now edit MimeType lists the same way.
Parse raw values so a quoted Exec matches and isn't rewritten each time.
A failing update-desktop-database no longer leaves the app as the default.
Edit it line by line instead of re-serializing it through rust-ini.
Only run update-desktop-database if the desktop file changed or the cache still lists the app.
xdg-mime exits with 4 on KDE and LXQt when no handler is set.
Compare the trimmed first line instead of the raw output.
Drop #[ignore], skip when the tools are missing, and install them on Linux CI.
@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through 9461d1c

There are 5 changes which include deep-link with patch, deep-link-js with patch, single-instance with patch, updater with minor, updater-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.55 2.0.56
api-example-js 2.0.51 2.0.52
deep-link-example-js 2.2.16 2.2.17
deep-link 2.6.1 2.6.2
deep-link-js 2.6.1 2.6.2
single-instance 2.5.3 2.5.4
updater 2.13.3 2.14.0
updater-js 2.13.3 2.14.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

lucasfernog
lucasfernog previously approved these changes Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants