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

[HOLD for payment 2023-12-07] [$500] iOS - Chat - Screen flickers after second double tap on large PDF file #30492

Closed
1 of 6 tasks
izarutskaya opened this issue Oct 27, 2023 · 47 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Oct 27, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.3.92-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation: @

Action Performed:

Pre-requisite: user must be logged in.

  1. Go to any chat.
  2. Send a large PDF file.
  3. Tap on the PDF preview.
  4. Double tap on it to zoom in.
  5. Double tap again.

Expected Result:

With the second double tap, the view should zoom in without any visual issues.

Actual Result:

After the second double tap, the screen flickers.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
Bug6252791_1698379115703.Scgx0548_1_.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01088b41c7fad72c6c
  • Upwork Job ID: 1717856931582775296
  • Last Price Increase: 2023-11-17
  • Automatic offers:
    • situchan | Reviewer | 27742246
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 27, 2023
@melvin-bot melvin-bot bot changed the title iOS - Chat - Screen flickers after second double tap on large PDF file [$500] iOS - Chat - Screen flickers after second double tap on large PDF file Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01088b41c7fad72c6c

@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

@alex2bc
Copy link
Contributor

alex2bc commented Oct 28, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Remove flickering after second double tap

What is the root cause of that problem?

The react-native-pdf has own custom double tap scroll mechanism with custom parameters specified in the PdfView file. It uses native ios PDFKit under the hood to display the pdf, but native PDFView of PDFKit has it's own double tap handler, so they conflict with each other when scroll is not default.

It's possible to replicate the bug if you pinch zoom a bit pdf document and then try to double tap, in that case even the first double tap will have flickering.

What changes do you think we should make in order to solve the problem?

We need to create empty double tap gesture handler for ios and attach it to the PDFView from PDFKit, so that it's not triggered and patch the library.

I've tested it and it fixes the issue 👌

@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@isabelastisser, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

@isabelastisser
Copy link
Contributor

@situchan can you please review the proposal above? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@situchan
Copy link
Contributor

@alex2bc can you please provide the followings?

  • test pdf
  • video before fix
  • video after fix
  • method for "empty double tap gesture handler"

@alex2bc
Copy link
Contributor

alex2bc commented Oct 30, 2023

@situchan Sure thing

Test PDF: 10840-001.pdf

Video BEFORE fix
Screenshot.2023-10-30.at.22.56.54.mp4
Video AFTER fix
Screenshot.2023-10-30.at.22.53.02.mp4

Below are the modifications of RNPDFPdfView.mm of react-native-pdf:

Empty obj-c double tap handler

-  (void)handleDoubleTapEmpty:(UITapGestureRecognizer *)recognizer {}

Attaching to the pdf view handler:

UITapGestureRecognizer *doubleTapEmptyRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                                                          action:@selector(handleDoubleTapEmpty:)];
doubleTapEmptyRecognizer.numberOfTapsRequired = 2;
[_pdfView addGestureRecognizer:doubleTapEmptyRecognizer];
_doubleTapEmptyRecognizer = doubleTapEmptyRecognizer;

Let me know if you need more info on it

@situchan
Copy link
Contributor

@alex2bc thanks for providing details. Have you tried to find any open issue in react-native-pdf?
It's ideal to fix this in upstream. We can try that first before applying patch.

@alex2bc
Copy link
Contributor

alex2bc commented Oct 30, 2023

@situchan Yes, I've gone through the open PR's and the issues and strangely no one experiences this issue. And worth mentioning we have the latest version of the lib.

@alex2bc
Copy link
Contributor

alex2bc commented Oct 30, 2023

Not a big fan of patching the libs as well, but use it as last option only

@melvin-bot melvin-bot bot added the Overdue label Nov 2, 2023
@isabelastisser
Copy link
Contributor

Hey @situchan, can you please follow up? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Nov 2, 2023
@situchan
Copy link
Contributor

situchan commented Nov 2, 2023

Was looking for ideal fix.

@alex2bc can you please try to raise issue/PR in upstream repo?
We can give that a try first.

Copy link

melvin-bot bot commented Nov 3, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@alex2bc
Copy link
Contributor

alex2bc commented Nov 4, 2023

@situchan Sure, we can give it a try. It makes sense because the problem is in the core functionality of the library.

What is our plan? I'm creating a pull request in the library repo. However, what should we do if the maintainer is unavailable for some time and the PR gets stuck? Should we patch the library and wait for the PR to be approved in the upstream repo to ensure that the issue is not blocked by the maintainer?

@alex2bc
Copy link
Contributor

alex2bc commented Nov 4, 2023

I've created a PR in the libs repo, will keep you updated 💪

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

@isabelastisser, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 19, 2023
@alex2bc
Copy link
Contributor

alex2bc commented Nov 19, 2023

@situchan
Copy link
Contributor

@alex2bc I didn't ask you to create PR. Should be approved by engineer.
Btw, android build is failing for me

android pdf build error

@alex2bc
Copy link
Contributor

alex2bc commented Nov 19, 2023

Ok, sure thing. Closed for now then

Will check it out

@luacmartins
Copy link
Contributor

Assigning @alex2bc to the issue.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 19, 2023
Copy link

melvin-bot bot commented Nov 19, 2023

📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 19, 2023

📣 @alex2bc You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Nov 21, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] iOS - Chat - Screen flickers after second double tap on large PDF file [HOLD for payment 2023-12-07] [$500] iOS - Chat - Screen flickers after second double tap on large PDF file Nov 30, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 30, 2023
Copy link

melvin-bot bot commented Nov 30, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Nov 30, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.5-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-12-07. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 30, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@situchan] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@isabelastisser] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@isabelastisser
Copy link
Contributor

@situchan can you please complete the list above? Thanks!

@situchan
Copy link
Contributor

situchan commented Dec 7, 2023

The issue was in upstream, not regression.
As minor UI bug and happened only on large PDF file, I don't suggest regression test

@isabelastisser
Copy link
Contributor

Payments are processed in Upwork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

5 participants