Closed r4dian closed 2 years ago
Thanks for the report. It sounds like you're doing everything right; the thing that jumps out to me is that the files are stored in Nextcloud. I signed up for and downloaded Nextcloud, and was able to reproduce the issue.
I don't know yet if they're doing something wrong, or if I am.
With a debug build I see the problem:
D/FilePickerWritable(16582): Got method call: getDirectory
W/DocumentsContract(16582): Failed to find path
W/DocumentsContract(16582): java.lang.UnsupportedOperationException: findDocumentPath not supported.
W/DocumentsContract(16582): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:174)
W/DocumentsContract(16582): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
W/DocumentsContract(16582): at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
W/DocumentsContract(16582): at android.content.ContentResolver.call(ContentResolver.java:2405)
W/DocumentsContract(16582): at android.provider.DocumentsContract.findDocumentPath(DocumentsContract.java:1634)
W/DocumentsContract(16582): at codeux.design.filepicker.file_picker_writable.QueryKt$getParent$2.invokeSuspend(Query.kt:92)
W/DocumentsContract(16582): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/DocumentsContract(16582): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
W/DocumentsContract(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
W/DocumentsContract(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
W/DocumentsContract(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
W/DocumentsContract(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
D/FilePickerWritable(16582): Error while handling method call io.flutter.plugin.common.MethodCall@c30eb46
D/FilePickerWritable(16582): java.lang.UnsupportedOperationException: findDocumentPath not supported.
D/FilePickerWritable(16582): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:174)
D/FilePickerWritable(16582): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
D/FilePickerWritable(16582): at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
D/FilePickerWritable(16582): at android.content.ContentResolver.call(ContentResolver.java:2405)
D/FilePickerWritable(16582): at android.provider.DocumentsContract.findDocumentPath(DocumentsContract.java:1634)
D/FilePickerWritable(16582): at codeux.design.filepicker.file_picker_writable.QueryKt$getParent$2.invokeSuspend(Query.kt:92)
D/FilePickerWritable(16582): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
D/FilePickerWritable(16582): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
D/FilePickerWritable(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
D/FilePickerWritable(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
D/FilePickerWritable(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
D/FilePickerWritable(16582): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
It appears that Nextcloud doesn't support DocumentsContract.findDocumentPath. This method is needed in order to resolve relative paths.
So while you can successfully grant access to a Nextcloud directory, that access doesn't allow resolving relative paths, which is why Orgro still prompts you to grant permission.
I don't think there's anything I can do about this, unless I have overlooked something in my implementation of path resolving that would allow me to eliminate calls to findDocumentPath
(and any other methods not supported by Nextcloud).
Actually I did have an alternate method of path resolving meant for older OSs. It's slow and it doesn't allow referencing parent directories (..
) but it will allow siblings and lower. I will put out a fix soon.
Little extra info, although it seems you've figured it out :
If I go in nextcloud app and select the org file - > open with... - > Orgo then it doesn't ask for permissions in Orgo but where the image would be is a message "can't resolve path relative to document"
If I go in nextcloud app and select the org file - > open with... - > Orgo
On Android this results in an extremely limited form of access that doesn't allow resolving against directory permissions.
v1.26.1 is now available through all channels.
Please reopen if the issue persists.
file:./python-matplot-fig.png
Expected result : Now the file is visible in the Orgo app
Actual result : The file doesn't load, the user is shown the same prompt