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 2024-06-05] [$250] Chat - PDF file blinks when open it #42103

Closed
1 of 6 tasks
lanitochka17 opened this issue May 13, 2024 · 23 comments
Closed
1 of 6 tasks
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

@lanitochka17
Copy link

lanitochka17 commented May 13, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.73-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: N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #41802

Action Performed:

  1. Open the app and log in
  2. Open any report
  3. If there are no PDF attachments in chat, send a PDF
  4. Open the PDF

Expected Result:

There is no blinking when opening a PDF file

Actual Result:

PDF file blinks while opening it regardless of size

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

Add any screenshot/video evidence

Bug6479696_1715624789229.IMG_6850.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0186b254f5f9f3fc2c
  • Upwork Job ID: 1790379082807984128
  • Last Price Increase: 2024-05-14
  • Automatic offers:
    • bernhardoj | Contributor | 0
Issue OwnerCurrent Issue Owner: @CortneyOfstad
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@CortneyOfstad FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@CortneyOfstad
Copy link
Contributor

Was able to recreate! Getting some eyes on this:

RecordIt-1715694475.MP4

@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label May 14, 2024
@melvin-bot melvin-bot bot changed the title Chat - PDF file blinks when open it [$250] Chat - PDF file blinks when open it May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0186b254f5f9f3fc2c

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

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

@bernhardoj
Copy link
Contributor

Proposal

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

The PDF blinks when opening it.

What is the root cause of that problem?

The loading comes from the PDF component when it's loading the pdf source.

<PDF
fitPolicy={0}
trustAllCerts={false}
renderActivityIndicator={() => <FullScreenLoadingIndicator />}

The reason it shows twice is, that when the loading is complete, we render the pdf component without the pressable,

return onPress && !successToLoadPDF ? (
<PressableWithoutFeedback
onPress={onPress}
style={[themeStyles.flex1, themeStyles.alignSelfStretch, !failedToLoadPDF && themeStyles.flexRow]}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON}
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
accessibilityLabel={fileName || translate('attachmentView.unknownFilename')}
>
{renderPDFView()}
</PressableWithoutFeedback>
) : (
renderPDFView()
);
}

so a new instance of PDF component is created because the component tree is changed and the loading starts again. The reason we don't want the pressable is because the PDF component already handles the onpress.

onPageSingleTap={onPress}

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

Disable the pressable instead of rendering it without pressable when the load completes, just like what we did before #21714.
disabled={successToLoadPDF}

@CortneyOfstad
Copy link
Contributor

@mananjadhav we have a proposal above for review — thanks!

@mananjadhav
Copy link
Collaborator

@bernhardoj 's proposal looks good to me.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented May 16, 2024

Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 16, 2024
Copy link

melvin-bot bot commented May 16, 2024

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 17, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @mananjadhav

@mananjadhav
Copy link
Collaborator

Thanks I'll take a look today.

@CortneyOfstad
Copy link
Contributor

Thanks @mananjadhav!

@mananjadhav
Copy link
Collaborator

The PR is straight forward but it seems it causes issues with scroll on Android. Put up a discussion in the PR comments here

@CortneyOfstad
Copy link
Contributor

Thanks @mananjadhav! Just a heads up that we're on a merge freeze until Wednesday 👍

@CortneyOfstad
Copy link
Contributor

Merge freeze is planned to end today 🤞

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] Chat - PDF file blinks when open it [HOLD for payment 2024-06-05] [$250] Chat - PDF file blinks when open it May 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 29, 2024
Copy link

melvin-bot bot commented May 29, 2024

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

Copy link

melvin-bot bot commented May 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.76-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 2024-06-05. 🎊

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

Copy link

melvin-bot bot commented May 29, 2024

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:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] 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:
  • [@mananjadhav] 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:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] 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.
  • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jun 2, 2024

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 4, 2024
@CortneyOfstad
Copy link
Contributor

Payment Summary

@bernhardoj — paid $250 via Upwork
@mananjadhav — to be paid $250 via NewDot

Thanks!

@JmillsExpensify
Copy link

$250 approved for @mananjadhav

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
No open projects
Archived in project
Development

No branches or pull requests

6 participants