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-05-23] [$1000] IOUPreview height should adjust based on content #18770

Closed
2 of 6 tasks
Julesssss opened this issue May 11, 2023 · 35 comments
Closed
2 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 Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.

Comments

@Julesssss
Copy link
Contributor

Julesssss commented May 11, 2023

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


Action Performed:

  1. Create an iou request to any user without adding a comment
  2. Settle the IOU
  3. Create an iou request to any user without adding a comment
  4. Settle the IOU

Expected Result:

  • The Card heights should be different

Actual Result:

  • The card heights are the same
  • The card without a description has a large gap where the comment would have shown

Native mobile
237498360-a96557f5-ee1f-4e71-be23-dd26fc659c7a (1)

Web
237498770-8c0574b2-9517-48a8-b763-46b3c29234f0

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.13-0
Issue reported by: @thesahindia here

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d6ca19ff51a2559a
  • Upwork Job ID: 1656655701807489024
  • Last Price Increase: 2023-05-11
@Julesssss Julesssss added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 11, 2023
@Julesssss Julesssss self-assigned this May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 11, 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

@huzaifa-99
Copy link
Contributor

huzaifa-99 commented May 11, 2023

Proposal

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

We want the IOUPreview to adjust its height based on content, specifically if it has a comment/description

What is the root cause of that problem?

The <Text> element for comment/description here is rendering always, regardless if there is any comment/description

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

We should conditionally render the <Text> component that displays comment/description here by first calculating description/value like this

const requestDescription = Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', ''))

and then render it like so

{requestDescription && <Text>{requestDescription}</Text>}
Result

image

What alternative solutions did you explore? (Optional)

N/A

@allroundexperts
Copy link
Contributor

allroundexperts commented May 11, 2023

Proposal

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

IOUPreview height does not adjust based on comment

What is the root cause of that problem?

The root cause is that we're always rendering the Text here.

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

We should render the text only if a comment exists for IOU. This gets replaced with:

// This can be saved in a variable as well
{lodashGet(props.action, 'originalMessage.comment', '') ? <Text style={[styles.colorMuted]}>{Str.htmlDecode(lodashGet(props.action, 'originalMessage.comment', ''))}</Text> : null}

Using && condition above will cause this regression. We should be using ternary instead.

Although not strictly required, we can also convert this and this into ternary expressions as well.

What alternative solutions did you explore? (Optional)

None

@Julesssss
Copy link
Contributor Author

Julesssss commented May 11, 2023

thanks both. This is pretty straight forward so I'm going with the first passable proposal (#18770 (comment)). Also creating requestDescription on a separate line is a bit more readable.

@Julesssss Julesssss added Improvement Item broken or needs improvement. Engineering labels May 11, 2023
@Julesssss
Copy link
Contributor Author

@huzaifa-99 feel free to make a start on the PR, I'll assign you once the UpWork job has been created 👍

@Julesssss
Copy link
Contributor Author

Actually I don't think anything will break if I do this now

@Julesssss
Copy link
Contributor Author

Julesssss commented May 11, 2023

Okay nevermind, that didn't trigger the automation, I'll do that again once Ted gets a chance to review.

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label May 11, 2023
@melvin-bot melvin-bot bot changed the title IOUPreview height should adjust based on content [$1000] IOUPreview height should adjust based on content May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Current assignee @twisterdotcom is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

@huzaifa-99
Copy link
Contributor

Thanks for the proposal review @Julesssss.

pull/18774 is ready!

@Julesssss Julesssss assigned huzaifa-99 and unassigned huzaifa-99 May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

📣 @huzaifa-99 You have been assigned to this job by @Julesssss!
Please apply to this job in Upwork 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 📖

@trjExpensify
Copy link
Contributor

Yup! Done!

@mountiny
Copy link
Contributor

Merged

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@trjExpensify
Copy link
Contributor

Strange, this should have got the reviewing label. PR is on staging. 👍

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@trjExpensify trjExpensify added the Reviewing Has a PR in review label May 15, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] IOUPreview height should adjust based on content [HOLD for payment 2023-05-23] [$1000] IOUPreview height should adjust based on content May 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 16, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 23, 2023
@huzaifa-99
Copy link
Contributor

Payment still pending guys 😄!

@mountiny
Copy link
Contributor

@trjExpensify was ooo but should be back today, sorry about that

@huzaifa-99
Copy link
Contributor

no worries @mountiny. Thank you!

@Julesssss
Copy link
Contributor Author

The issue will remain open until paid, and Tom will be back soon :)

@trjExpensify
Copy link
Contributor

Yuuup, I got back today. 👍 Looking at this now, appreciate the patience.

@aimane-chnaif
Copy link
Contributor

No PR caused regression. This is more like polish than bug and found during PR review here.
So no need regression test step.

@trjExpensify
Copy link
Contributor

Yup, this was when adding a new feature. Regression tests will be updated more broadly for the manual requests redesign.

@trjExpensify
Copy link
Contributor

Okay, so my assessment for payments is as follows:

@aimane-chnaif - $1,500 for the C+ review & #urgency bonus
@huzaifa-99 - $1,500 for the fix & #urgency bonus
@thesahindia - $250 for reporting the bug in this PR

Does that sound right to everyone?

@trjExpensify
Copy link
Contributor

Offers have been sent to all three of you in the meantime.

@huzaifa-99
Copy link
Contributor

Thank you @trjExpensify. Accepted!

@trjExpensify
Copy link
Contributor

trjExpensify commented May 25, 2023

Settled up with @huzaifa-99 & @aimane-chnaif. Awaiting @thesahindia and then I'll close this out.

Job ref for ease.

@thesahindia
Copy link
Member

Accepted, thanks!

@trjExpensify
Copy link
Contributor

Awesome, settled. Closing!

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 Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

10 participants