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

Uploaded PDF can't be viewed #3487

Closed
gnprice opened this issue May 16, 2019 · 4 comments
Closed

Uploaded PDF can't be viewed #3487

gnprice opened this issue May 16, 2019 · 4 comments

Comments

@gnprice
Copy link
Member

gnprice commented May 16, 2019

A user reports:

I did send out several of PDFs to private messages of my members.
Everybody that uses the App could not open the PDFs. The message was "Cannot open PDF".
The members with web application had no problem opening the PDFs

The recipients they've heard from are all on Android; we don't know if the issue is also present on iOS.

Apparently it did work for another recipient, though, also on Android!

now I got feedback from somebody with Android and the App and it worked! How about that?

So that could be a very interesting clue.

I briefly experimented trying to reproduce it: I uploaded a PDF from the webapp, sent the message, saw it on the mobile app, and tried following the link. For me with v24.0.113 on Android 9 aka P, the issue

  • does reproduce on an org on zulipchat.com;
  • does not reproduce on chat.zulip.org -- things work fine there.

When it reproduces, the behavior is:

  • The PDF viewer app appears on screen, and shows its "working" animation
  • Shortly thereafter, the PDF viewer goes away and the Zulip message list returns to the foreground
  • A "toast" (a temporary bubble near the bottom of the screen) appears, with the message "Cannot display PDF ( sagas.pdf cannot be opened)" (where sagas.pdf is the filename of the PDF; extra space sic)

The difference between servers is presumably because chat.zulip.org hosts uploaded files locally, while zulipchat.com hosts them on S3. In particular on zulipchat.com (and with the S3 backend generally), when the client requests an uploaded file, the server returns a redirect to a URL in S3; we may not be handling the redirect properly.

If so, this may be another symptom of the same underlying issue as the cause of #3124 .

@gnprice
Copy link
Member Author

gnprice commented May 16, 2019

Other related issues:

@borisyankov
Copy link
Contributor

Maybe also this #2115

borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue May 22, 2019
Fixes zulip#3487
Fixes zulip#3303 (but does not implement the exact suggestion)

Just as we do with images, check if a link is local and is poining
to `/user_uploads/`. If so, adds the `api_key` value to the url
to enable opening it in Chrome Custom Tab / Safari View.

The file can then be downloaded via the oveflow menu (three-dots)
on Android. On iOS, similar actions can be taken via the 'Share'
button available at the bottom of the screen.
@borisyankov
Copy link
Contributor

After some research and experiments, that looks to be the same issue as #3303

The difference is the platforms:

  • on Android - after opening fails we go back to the message list
  • on iOS - we get a login screen

borisyankov added a commit to borisyankov/zulip-mobile that referenced this issue May 23, 2019
Fixes zulip#3487
Fixes zulip#3303 (but does not implement the exact suggestion)

Just as we do with images, check if a link is local and is poining
to `/user_uploads/`. If so, adds the `api_key` value to the url
to enable opening it in Chrome Custom Tab / Safari View.

The file can then be downloaded via the oveflow menu (three-dots)
on Android. On iOS, similar actions can be taken via the 'Share'
button available at the bottom of the screen.
@gnprice
Copy link
Member Author

gnprice commented May 25, 2019

Thanks @borisyankov for the investigation, and the additional link!

Based on those findings, I'll close this to consolidate on #3303 -- though as noted there, the set of reports is still a bit confusing and doesn't quite fit any pattern we yet understand. (In particular the original report in #3303 is on Android but describes a login screen.)

@gnprice gnprice closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants