Claude/bug opening a file from recents fails with a permi l fad j#29
Merged
kevincarlson merged 2 commits intoMar 30, 2026
Conversation
…rks after restart On Android, the Storage Access Framework grants only a *temporary* permission when the user picks a file via the file picker. That permission is revoked when the app process is killed, which is why opening a file from Recents after an app restart failed with a permissions error. Fix: - Add UriPermissionPlugin.kt: a Tauri Android plugin that calls ContentResolver.takePersistableUriPermission() for a given content:// URI. - Register the plugin in MainActivity.kt. - Add takePersistableUriPermission() TypeScript wrapper in commands.ts. - Call it in useFileOperations.loadDocument() and handleSaveAs() whenever a content:// URI is opened or saved for the first time, so the permission is durably stored and survives subsequent app restarts. Errors from the permission call are swallowed (non-fatal) so the fix is transparent on desktop platforms and on URIs that don't support persistence. Fixes #24 https://claude.ai/code/session_01KdVehRZ9Rk2MyyEuzSbpHJ
Merging fix for Android file I/O permissions
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Android's Storage Access Framework (SAF) grants only a temporary permission for a content:// URI when the user picks a file via the file picker. That permission is tied to the app process and is revoked when the app is killed. Attempting to re-open the same URI from Recents in a new session therefore fails with a permissions error.
Fix — 4 changes: