Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] VIEW intents are not handled #133

Closed
flokol120 opened this issue Mar 4, 2023 · 2 comments · Fixed by #135
Closed

[BUG] VIEW intents are not handled #133

flokol120 opened this issue Mar 4, 2023 · 2 comments · Fixed by #135
Assignees
Labels
bug Something isn't working

Comments

@flokol120
Copy link
Contributor

Describe the bug
If you open (view) a file from another app, the app won't trigger the same event as the share feature.

To Reproduce
Steps to reproduce the behavior: Open (not share!) e.g. a .pdf file using a file explorer. (I used total commander)

Expected behavior
Either not being able to view a document using the app at all or handling viewing of a document like sharing a document with the app.

Device Information:

  • Device: OnePlus 8T
  • OS: Android 13
  • Paperless Mobile version 2.0.9
  • Paperless Server version 1.12.2

Additional context
I already did some debugging:
As the Manifest.xml includes not only android.intent.action.SEND but also android.intent.action.VIEW intents (AndroidManifest.xml:53-62) for all file types a user can "open" pdfs with the app. However only send intents are captured using ReceiveSharingIntent.getMediaStream() and ReceiveSharingIntent.getInitialMedia() (main.dart:284-288). To capture/listen for view intents ReceiveSharingIntent.getInitialText() and ReceiveSharingIntent.getTextStream() must be used. The only Problem being with those events is, they only include URIs to the opened file. So in order to use them they must be opened prior to the upload which makes it incompatible with the handling of SharedMediaFile in the share_intent_queue.dart (share_intent_queue.dart).

As I only took a quick look into this project I cannot estimate how difficult an implementation would be by using those URIs when viewing files within the app. So my suggestion would be to either remove the VIEW intents or handle the URIs using the methods outlined above.

It just left my puzzling why the "sharing" did not work as I confused it with the "viewing" of the file at first. Before diving deeper I assumed sharing/viewing is not working at all.

@flokol120 flokol120 added the bug Something isn't working label Mar 4, 2023
@astubenbord
Copy link
Owner

Hi, I think removing the VIEW intents is the best way to go then, what do you think?

@flokol120
Copy link
Contributor Author

flokol120 commented Mar 5, 2023

Maybe I've missed something, but I'd say that would be the easiest solution to not confuse users I guess :) I'll get a PR ready

astubenbord pushed a commit that referenced this issue Apr 2, 2024
VIEW Intents are not handled within the app, thus confusing the user when trying to open a file using the app.

fixes #133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants