owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.76k stars 3.09k forks source link

[BUG] Deep links over shared files (oCIS) #4250

Open jesmrec opened 6 months ago

jesmrec commented 6 months ago

Comes from https://github.com/owncloud/android/pull/4212#issuecomment-1840841042

Deep links over shared files are not implemented. It's causing a crash:

                                                                                                    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.owncloud.android/com.owncloud.android.ui.activity.FileDisplayActivity}: java.net.URISyntaxException: Illegal character in path at index 227: owncloud://ocis.ocis-wopi.latest.owncloud.works/f/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668%2142117dc5-c175-49a3-a683-4827bd3fe444:4374bf79-85db-4821-948e-4ca06a32726b:db2f83b4-0c8f-4c2e-8539-7b2
                                                                                                    11458f7d6
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
                                                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
                                                                                                        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                                                                                                        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loop(Looper.java:223)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:7656)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
                                                                                                    Caused by: java.net.URISyntaxException: Illegal character in path at index 227: owncloud://ocis.ocis-wopi.latest.owncloud.works/f/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668%2142117dc5-c175-49a3-a683-4827bd3fe444:4374bf79-85db-4821-948e-4ca06a32726b:db2f83b4-0c8f-4c2e-8539-7b2
                                                                                                    11458f7d6
                                                                                                        at java.net.URI$Parser.fail(URI.java:2893)
                                                                                                        at java.net.URI$Parser.checkChars(URI.java:3066)
                                                                                                        at java.net.URI$Parser.parseHierarchical(URI.java:3150)
                                                                                                        at java.net.URI$Parser.parse(URI.java:3098)
                                                                                                        at java.net.URI.<init>(URI.java:584)
                                                                                                        at com.owncloud.android.presentation.files.operations.FileOperationsViewModel.handleDeepLink(FileOperationsViewModel.kt:145)
                                                                                                        at com.owncloud.android.ui.activity.FileDisplayActivity.handleDeepLink(FileDisplayActivity.kt:1777)
                                                                                                        at com.owncloud.android.ui.activity.FileDisplayActivity.onCreate(FileDisplayActivity.kt:193)
                                                                                                        at android.app.Activity.performCreate(Activity.java:8000)
                                                                                                        at android.app.Activity.performCreate(Activity.java:7984)
                                                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)

apart of avoiding the crash, app should resolve the link using the meta endpoint (guessing that item is reachable) and show it as any other item in the Shares tab.

TASKS

jesmrec commented 6 months ago

Crash in the top message happened because there was a blank in the link string. We could prevent this but it's not a problem in the links to shared items.

JuancaG05 commented 6 months ago

Blocked due to:

JuancaG05 commented 5 months ago

Blocked again due to:

jesmrec commented 4 months ago

Tracking: https://github.com/owncloud/ocis/issues/8455