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

[waiting for payment][$250] Share code- QR code expands to full size after opening for WS rooms, tasks and threads #44436

Closed
1 of 6 tasks
izarutskaya opened this issue Jun 26, 2024 · 44 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Jun 26, 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: 9.0.2-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4675372
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Open the app and log in
  2. Navigate to any task, thread or a workspace room
  3. Tap the header and select Share

Expected Result:

The QR code is displayed fully

Actual Result:

The QR code is displayed small briefly and expands to the full 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

Bug6524801_1719378147729.video_2024-06-26_00-59-25.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e0a4dbc404a8ab34
  • Upwork Job ID: 1805949354249394574
  • Last Price Increase: 2024-07-10
  • Automatic offers:
    • alitoshmatov | Reviewer | 103091801
    • huult | Contributor | 103091804
Issue OwnerCurrent Issue Owner: @adelekennedy
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 26, 2024
Copy link

melvin-bot bot commented Jun 26, 2024

Triggered auto assignment to @adelekennedy (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.

Copy link

melvin-bot bot commented Jun 26, 2024

Triggered auto assignment to @danieldoglas (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@izarutskaya
Copy link
Author

@adelekennedy 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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb

@huult
Copy link
Contributor

huult commented Jun 26, 2024

Proposal

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

QRCode change size after layout change

What is the root cause of that problem?

Default QR code size is 120px, after layout change the QR code recalculate size at this line

setQrCodeSize(Math.max(1, containerWidth));

so the UI QRCode will update width and height

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

We have to set the default initial height for qrcode size at this line base on platform

const [qrCodeSize, setQrCodeSize] = useState<number | undefined>();

ST like that

+    const isMobilePlatform = Platform.OS === 'android' || Platform.OS === 'ios';
+    const isMobileBrowser = Browser.isMobile();
+    const isMobile = isMobilePlatform || isMobileBrowser;
+    const { windowWidth } = useWindowDimensions();
+.   const qrShareContainerWidth = isMobile ? windowWidth : variables.sideBarWidth;


-     const [qrCodeSize, setQrCodeSize] = useState<number | undefined>();
+    // styles.ph5.paddingHorizontal * 2: This is the padding outside of the QR code.
+    // variables.qrShareHorizontalPadding * 2: This is the padding inside of the QR code.
+    // default size is remaining width after minus padding from parent container
+    const [qrCodeSize, setQrCodeSize] = useState<number>(
+        qrShareContainerWidth - (styles.ph5.paddingHorizontal * 2) - (variables.qrShareHorizontalPadding * 2)
+    );
POC
Screen_Recording_20240706_090235_New.Expensify.Dev.mp4

What alternative solutions did you explore? (Optional)

@Sparth19
Copy link

Proposal

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

  • The QR code is initially displayed briefly in a small size before expanding to full size.

What is the root cause of that problem?

  • The initial value of qrCodeSize is undefined, so it defaults to 120.

  • It is displayed at this size initially, and then adjusts based on onLayout changes.

    const onLayout = (event: LayoutChangeEvent) => {
    const containerWidth = event.nativeEvent.layout.width - variables.qrShareHorizontalPadding * 2 || 0;
    setQrCodeSize(Math.max(1, containerWidth));
    };

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

  • we can use a Loader While onLayout is Calculating the Size.

  • This will ensure that the QR code is displayed at the correct size from the beginning and avoids any brief display of an incorrectly sized QR code or resizing issues in any device sizes.

         {qrCodeSize ? (
              <QRCode
                  getRef={(svg) => (svgRef.current = svg)}
                  url={url}
                  logo={logo}
                  size={qrCodeSize}
                  logoRatio={logoRatio}
                  logoMarginRatio={logoMarginRatio}
              />
          ) : (
              <ActivityIndicator
                  color={theme.spinner}
                  size="large"
              />
          )}
    

What alternative solutions did you explore? (Optional)

@danieldoglas danieldoglas added the External Added to denote the issue can be worked on by a contributor label Jun 26, 2024
@melvin-bot melvin-bot bot changed the title Share code- QR code expands to full size after opening for WS rooms, tasks and threads [$250] Share code- QR code expands to full size after opening for WS rooms, tasks and threads Jun 26, 2024
Copy link

melvin-bot bot commented Jun 26, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01e0a4dbc404a8ab34

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

melvin-bot bot commented Jun 26, 2024

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

@yuwenmemon yuwenmemon removed the DeployBlocker Indicates it should block deploying the API label Jun 26, 2024
@danieldoglas danieldoglas added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jun 26, 2024
Copy link

melvin-bot bot commented Jul 2, 2024

@danieldoglas, @alitoshmatov, @adelekennedy Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Jul 2, 2024
@mountiny
Copy link
Contributor

@dominictb I understand your concern, and I am sorry that this time, it did not work out. I think both of you and your solutions will work, and they are similar, so @huult should go ahead, as their proposal came in first.

@huult what is your ETA for the PR?

@huult
Copy link
Contributor

huult commented Jul 12, 2024

I will create the pull requests soon. The ETA is the next day. Thank you.

@dominictb
Copy link
Contributor

@mountiny @danieldoglas Thanks for your answer

huult added a commit to huult/App that referenced this issue Jul 13, 2024
huult added a commit to huult/App that referenced this issue Jul 13, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 13, 2024
@huult
Copy link
Contributor

huult commented Jul 13, 2024

here is my PR

@huult
Copy link
Contributor

huult commented Jul 31, 2024

Hi @mountiny , @danieldoglas , My PR was merged to production a week ago, but I noticed the Mevin bot isn't working as expected compared to other tickets I've worked on. Can I ask if this ticket is currently able to process a payment?
Thank you!

@danieldoglas danieldoglas added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Aug 1, 2024
@danieldoglas danieldoglas changed the title [$250] Share code- QR code expands to full size after opening for WS rooms, tasks and threads [waiting for payment][$250] Share code- QR code expands to full size after opening for WS rooms, tasks and threads Aug 1, 2024
@adelekennedy
Copy link

adelekennedy commented Aug 1, 2024

ty @danieldoglas let me handle payment now:

Payouts due:

Upwork job is here.

@melvin-bot melvin-bot bot removed the Overdue label Aug 1, 2024
@adelekennedy
Copy link

adelekennedy commented Aug 1, 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 @alitoshmatov

  • The PR that introduced the bug has been identified. Link to the PR:
  • 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:
  • 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:
  • A regression test has been added or updated so that the same bug will not reach production again. Link to the GH issue for creating the test here:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 7, 2024
@adelekennedy
Copy link

@alitoshmatov checklist above when you get a chance!

@melvin-bot melvin-bot bot removed the Overdue label Aug 7, 2024
@adelekennedy adelekennedy removed the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 7, 2024
@alitoshmatov
Copy link
Contributor

alitoshmatov commented Aug 10, 2024

  • The PR that introduced the bug has been identified. Link to the PR: Migrate QRShare to function component #32690
  • 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: https://github.com/Expensify/App/pull/32690/files#r1712561692
  • 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: No need
  • Determine if we should create a regression test for this bug.

Regression Test Proposal

  1. Open the app and log in.
  2. Navigate to any task, thread, or workspace room.
  3. Tap the header to open the details and select "Share".
  4. Verify that the QR code is displayed in full size and not changing its size while page is opening.

Do we agree 👍 or 👎

cc: @adelekennedy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering 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

10 participants