fix(mobile): open Quick Links in the external browser so JotForm data survives the camera #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/links-external-browser"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Quick Links opened in an in-app Chrome Custom Tab. A Custom Tab belongs to this app's process, so when Android kills the backgrounded app - routine on Samsung One UI the moment something memory-hungry like the camera starts - the tab is destroyed and any half-filled JotForm goes with it.
That is the same failure the dispatch board's Work Order flow had. It was fixed there by handing the URL to the OS default browser, which gets its own Android task and survives the app being killed.
Why Quick Links was missed
The mechanism was already in place -
openPluginMobile(..., external)- and the JSDoc already described this exact camera scenario. Butexternaldefaulted to false, and both Quick Links call sites simply omitted the argument:So this was not an oversight in the links plugin at all - nothing in
slash-links-pluginneeds to change. It was a default that made the unsafe path the quiet one.Changes
externalnow defaults totrue. Every current caller opens a page that leads to a JotForm, so the safe behaviour is the default and a new call site cannot reintroduce this bug by omission. Passingfalseis now a deliberate act, documented as being for pages with no form state worth protecting.trueexplicitly, for readability at the call site.Checked before changing
Linking.openURLcould in principle bounce straight back into the app if it registered an intent filter for the server host. It does not -AndroidManifest.xmldeclares only theslash://andslashauth://custom schemes, nohttpshost. So the URL goes to the default browser as intended.Trade-off
The technician now leaves the Slash app when they open Quick Links, and returns via the app switcher rather than a back button. That is the same trade already accepted for the dispatch board, and it is the price of the form surviving a trip to the camera.
Note on delivery
Unlike the plugin-side work, this needs a new APK on each phone - it will not reach anyone through a server deploy.