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

[$500] Distance - Distance rate shows $TBD instead of TBD in offline mode #30376

Closed
6 tasks done
lanitochka17 opened this issue Oct 25, 2023 · 24 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 25, 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.91-1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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:

Precondition:

  • There is at least a workspace
  • Log out and log in again and do not open workspace and request money page
  1. Navigate to staging.new.expensify.com
  2. Go offline
  3. Go to + > Request money > Distance
  4. Enter any start and finish point
  5. Proceed to the confirmation page
  6. Go to the distance request (preview, details page)

Expected Result:

The distance rate shows TBD

Actual Result:

The distance rate shows $TBD instead of TBD

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
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6250523_1698251124492.20231025_125454.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ffaa57ea238f4625
  • Upwork Job ID: 1717251966495088640
  • Last Price Increase: 2023-10-25
@lanitochka17 lanitochka17 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 25, 2023
@melvin-bot melvin-bot bot changed the title Distance - Distance rate shows $TBD instead of TBD in offline mode [$500] Distance - Distance rate shows $TBD instead of TBD in offline mode Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

Triggered auto assignment to @adelekennedy (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 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 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 25, 2023

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

@rojiphil
Copy link
Contributor

Proposal

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

Distance rate shows $TBD instead of TBD in offline mode

What is the root cause of that problem?

The distance rate is determined here where the currency symbol is attached to the ratePerUnit. However, the currency symbol is applied even when rate is not available. This is the root cause

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

To solve the problem, we need to set the currencySymbol to empty string if rate is invalid like this:

const currencySymbol = rate ? CurrencyUtils.getCurrencySymbol(currency) || ${currency} : ‘’;

What alternative solutions did you explore? (Optional)

@GItGudRatio
Copy link
Contributor

Proposal

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

Distance rate shows $TBD instead of TBD in offline mode

What is the root cause of that problem?

To display the string present in the menu item, we use the getDistanceMerchant function.

const getDistanceMerchant = (hasRoute, distanceInMeters, unit, rate, currency, translate, toLocaleDigit) => {

We always show the currency symbol, regardless of the rate, thus causing this bug.

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

We need to consider if the rate is present an use the symbol only then. We can add a simple conditional to currencySymbol such that:

  1. If the rate is present, show the currency symbol.
  2. Else, do not show anything and use an empty string for symbol.
    const currencySymbol = CurrencyUtils.getCurrencySymbol(currency) || `${currency} `;

What alternative solutions did you explore? (Optional)

@GItGudRatio
Copy link
Contributor

Would just like to mention, isn't adding code diffs to the proposal against the proposal guidelines? I got delayed by a few seconds just because I was trying to word it out properly and adding the references instead of just pasting the code. Please do consider this when judging the proposals!

Thanks!

@Santhosh-Sellavel
Copy link
Collaborator

This is a simple and straightforward issue

@rojiphil's proposal looks good to me!

C+ Reviewed
🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@Santhosh-Sellavel
Copy link
Collaborator

@GItGudRatio

I got delayed by a few seconds

These are bound to happen on simple issues, better luck next time.

Isn't adding code diffs to the proposal against the proposal guidelines

Yeah, large diffs without explaining the root cause. But I'm good with this as it's a relatively simpler one!

cc: @luacmartins

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 25, 2023
@rojiphil

This comment was marked as outdated.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 26, 2023
@rojiphil
Copy link
Contributor

@Santhosh-Sellavel
PR is ready for review

@puneetlath
Copy link
Contributor

According to QA this is still happening on iOS, so let's make sure it also gets fixed there.

@rojiphil
Copy link
Contributor

rojiphil commented Nov 9, 2023

According to QA this is still happening on iOS, so let's make sure it also gets fixed there.

@puneetlath

I am not able to reproduce the problem on the latest main (v1.3.97-1) with both iOS native and iOS mweb. Also, attaching the test videos for reference below. Maybe I am missing something simple here.

Not sure whom to approach in QA for reproducing the problem.
Can we get the QA to send a test video to demonstrate the problem on iOS?

30376-ios-native-2.mp4
30376-mweb-safari-2.mp4

@kavimuru
Copy link

kavimuru commented Nov 9, 2023

@rojiphil I am not able to reproduce $TBD but I see the mileage rate in offline mode in the latest build.

MNFM7884.1.MP4

@rojiphil
Copy link
Contributor

rojiphil commented Nov 9, 2023

I am not able to reproduce $TBD but I see the mileage rate in offline mode in the latest build.

@kavimuru

Ok. Got it. I think the test description along with the precondition may help here. And sorry for the lack of clarity in the test steps.
I have updated that in the PR Test Section here.
Can you please try again along with the precondition?
Let me know if you still face problems.

@kavimuru
Copy link

kavimuru commented Nov 9, 2023

@rojiphil Thanks will validate and update you.

@kavimuru
Copy link

kavimuru commented Nov 9, 2023

@rojiphil It's a pass following the precondition and revised steps

RPReplay_Final1699544846.MP4

@rojiphil
Copy link
Contributor

@adelekennedy
Now that the fix has been in production since Nov 10 according to this comment here,
can we not go ahead with the payments?

@adelekennedy
Copy link

adelekennedy commented Nov 22, 2023

yes! Sorry about that it looks like this didn't update automatically

Payouts due:

Contributor: $500 @rojiphil (Upwork)
Contributor+: $500 @Santhosh-Sellavel (NewDot)

Upwork job is here @rojiphil will you apply?

@rojiphil
Copy link
Contributor

rojiphil commented Nov 22, 2023

Upwork job is here @rojiphil will you apply?

@adelekennedy
Just applied using the link. Thanks for taking this forward.

@Santhosh-Sellavel
Copy link
Collaborator

@adelekennedy I'm C+ here can you update payment summary please, thanks!

@JmillsExpensify
Copy link

@adelekennedy re-opening for payment summary.

@JmillsExpensify
Copy link

Apologies, I missed this payment summary. $500 payment approved for @Santhosh-Sellavel.

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants