fix(linux): pass deep-link URL to the app so sign-in works on cold start - #151
Merged
Blankll merged 1 commit intoSep 15, 2026
Merged
Conversation
The bundled desktop entry advertises SqlKit as the sqlkit:// handler but
never forwards the URL, so signing in on Linux silently does nothing when
the app is not already running.
tauri-bundler derives MimeType=x-scheme-handler/sqlkit from the deep-link
config, so the desktop routes sqlkit:// links to SqlKit. Its template then
emits a bare `Exec={{exec}}` with no field code, so the URL is dropped
instead of being appended to argv. tauri-plugin-deep-link builds its URL
list from std::env::args() at init, so get_current() returns None, the
cold-start branch in lib.rs never fires, and the sqlkit://auth event that
App.vue listens for is never emitted. The token, username and email from
the callback are lost.
Add a custom desktopTemplate with `Exec={{exec}} %u`. The plugin's own
runtime-registration template already uses `%u`, so this aligns the
bundled entry with what the plugin expects. StartupWMClass keeps the bare
{{exec}} so window grouping still matches the binary, and Name keeps
{{name}} since productName is already capitalized.
Also set bundle.category, which was unset and left Categories= empty, so
the app files under no menu category. DeveloperTool maps to Development;
on freedesktop and public.app-category.developer-tools on macOS.
Wired into deb and rpm since both are published; AppImage inherits the
deb template because its bundler reuses debian::generate_data.
anandghegde
force-pushed
the
fix/linux-deep-link-exec-field-code
branch
from
September 13, 2026 08:06
b265a8d to
fdd0ccc
Compare
anandghegde
force-pushed
the
fix/linux-deep-link-exec-field-code
branch
from
September 14, 2026 04:46
fdd0ccc to
9c41d2a
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Blankll
approved these changes
Sep 15, 2026
Blankll
left a comment
Member
There was a problem hiding this comment.
looks good, thanks your contribution! @anandghegde
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On Linux, clicking the
sqlkit://auth?...sign-in callback while SqlKit is not already running launches the app but never signs you in. The token is silently dropped.The desktop entry advertises SqlKit as the
sqlkit://handler, so the link is routed to the app correctly — it just arrives empty.Why
Four links in the chain, all in current
master:The handler is advertised.
tauri-bundlerderivesMimeType=x-scheme-handler/sqlkitfrom thedeep-linkconfig intauri.conf.json(deep_link_protocols()branch infreedesktop/mod.rs), so the desktop dispatchessqlkit://links to SqlKit.But the URL is never passed. The bundler's stock template emits a bare
Exec={{exec}}with no field code (main.desktop). Per the Desktop Entry spec, a handler only receives the URL ifExec=carries%u/%U. Without it the URL is discarded rather than appended to argv.The plugin reads argv.
tauri-plugin-deep-linkbuilds its URL list fromstd::env::args()at init (handle_cli_arguments), soget_current()returnsNone.So the auth event never fires.
src-tauri/src/lib.rs#L197—if let Ok(Some(urls)) = app.deep_link().get_current()— never enters,parse_auth_from_urlis never called, and thesqlkit://authevent thatsrc/App.vue#L32listens for is never emitted.accountStore.setAuth(token, username, email)never runs.Worth noting: the deep-link plugin's own runtime-registration template already uses
Exec="{path}" %u, so%uis what the plugin expects. SqlKit doesn't callregister(), so it relies on the bundled entry — which lacks it.Changes
New
src-tauri/linux/SqlKit.desktop— the bundler's stock template with%uadded:Exec={{exec}} %usrc-tauri/tauri.conf.json— pointsdebandrpmat that template, and setsbundle.category, which was unset and leftCategories=empty so the app files under no menu category.Rendered output:
Notes on the approach
StartupWMClassdeliberately keeps bare{{exec}}with no%u— it must match the actual WM class or window-to-launcher grouping breaks.Namekeeps{{name}}, sinceproductNameis alreadySqlKit. NoproductNamechange, so the binary name, WM class and updater artifacts are untouched.DeveloperToolmaps toDevelopment;on freedesktop andpublic.app-category.developer-toolson macOS (category.rs), so this also fills in the previously-unset App Store category.debian::generate_data, so it inherits the deb template.Separate observation, not addressed here
lib.rslistens fordeep-link://new-urlto handle links arriving while the app is already running, buttauri-plugin-single-instanceisn't registered. On Linux and Windows that event is emitted through the single-instance integration, so that handler looks like it can't fire on those platforms today — a secondsqlkit://click spawns a new process instead of reaching the running one.This PR doesn't touch that, since adding single-instance changes app behavior (no more multiple windows) and that's a product call. With
%uin place the new process at least receives the token via argv and signs in. Happy to open a follow-up issue if it's worth tracking.Verification
tauri-bundlersupplies (categories,comment,exec,icon,name,mime_type) — output above.ExecisSqlKit %u,StartupWMClassstays bare,MimeTypeis intact,Categoriesis;-terminated.tauri.conf.jsonagainst the official schema for the resolvedtauri 2.11.3— passes.BundleConfig,DebConfigandRpmConfigall setadditionalProperties: false, confirmingcategoryanddesktopTemplateare recognized keys rather than silently ignored.If you add a preview/build label I'm glad to help confirm on the resulting .deb that
sqlkit://auth?...signs in from a closed state.