Skip to content

[Due for payment 2025-05-27] [$250] Cancellation policy in NewDot contradicts cancellation policy in Spotnana #60835

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

Open
9 of 18 tasks
stitesExpensify opened this issue Apr 24, 2025 · 17 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@stitesExpensify
Copy link
Contributor

stitesExpensify commented Apr 24, 2025

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: 9.1.29-10
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @JmillsExpensify
Slack conversation (hyperlinked to channel name): #travel

Action Performed:

  1. Book a hotel
  2. Go to the details in Expensify
  3. Look at Cancellation policy and compare it to Spotnana

Expected Result:

The policies match

Actual Result:

They are different

Image

Image

Workaround:

n/a

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021915703191769199540
  • Upwork Job ID: 1915703191769199540
  • Last Price Increase: 2025-04-25
Issue OwnerCurrent Issue Owner: @laurenreidexpensify
@stitesExpensify stitesExpensify added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Apr 24, 2025
Copy link

melvin-bot bot commented Apr 24, 2025

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

@ChavdaSachin
Copy link
Contributor

Proposal

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

Cancellation policy in NewDot contradicts cancellation policy in Spotnana

What is the root cause of that problem?

The date received from spotnata is not being converted to local time first, while on the spotnata page it is displayed in local time which causes the issue.

const cancellationText = reservation.cancellationDeadline
? `${translate('travel.hotelDetails.cancellationUntil')} ${DateUtils.getFormattedTransportDateAndHour(new Date(reservation.cancellationDeadline)).date}`
: cancellationMapping[reservation.cancellationPolicy ?? CONST.CANCELLATION_POLICY.UNKNOWN];

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

First convert the date to local time here

const cancellationText = reservation.cancellationDeadline
? `${translate('travel.hotelDetails.cancellationUntil')} ${DateUtils.getFormattedTransportDateAndHour(new Date(reservation.cancellationDeadline)).date}`
: cancellationMapping[reservation.cancellationPolicy ?? CONST.CANCELLATION_POLICY.UNKNOWN];

Additionally add a *local time remark to make it supper clear for customer. like on spotnata website.

Optionally we should add the hours as well(coz there could be scenarios where cancellation would not be allowed for whole day and if customer tries to cancel it during later hours of the day it may be not available to free cancel.

Do the same for other bookings as well.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

@laurenreidexpensify laurenreidexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 25, 2025
@melvin-bot melvin-bot bot changed the title Cancellation policy in NewDot contradicts cancellation policy in Spotnana [$250] Cancellation policy in NewDot contradicts cancellation policy in Spotnana Apr 25, 2025
Copy link

melvin-bot bot commented Apr 25, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 25, 2025
Copy link

melvin-bot bot commented Apr 25, 2025

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

@linhvovan29546
Copy link
Contributor

linhvovan29546 commented Apr 26, 2025

Proposal

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

Cancellation policy in NewDot contradicts cancellation policy in Spotnana

What is the root cause of that problem?

In HotelTripDetail, we format the cancellationDeadline using the format Wednesday, Mar 17 8:00 AM or Wednesday, Mar 17, 2023 8:00 AM, while Spotnana displays it using the local time format MMM d, yyyy, HH:mm a. This mismatch causes inconsistencies in the displayed cancellation policy.

const cancellationText = reservation.cancellationDeadline
? `${translate('travel.hotelDetails.cancellationUntil')} ${DateUtils.getFormattedTransportDateAndHour(new Date(reservation.cancellationDeadline)).date}`
: cancellationMapping[reservation.cancellationPolicy ?? CONST.CANCELLATION_POLICY.UNKNOWN];

App/src/libs/DateUtils.ts

Lines 866 to 872 in a9b6d36

/**
* Returns a formatted flight date and hour.
* Dates are formatted as follows:
* 1. When the date refers to the current year: Wednesday, Mar 17 8:00 AM
* 2. When the date refers not to the current year: Wednesday, Mar 17, 2023 8:00 AM
*/
function getFormattedTransportDateAndHour(date: Date): {date: string; hour: string} {

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

We should format cancellationDeadline on the frontend to MMM d, yyyy, HH:mm a followed by 'local time'. To achieve this:

  1. Create a new date util function:
function formatLocalCancellationDate(dateTime: string | Date, locale: Locale = CONST.LOCALES.EN): string {
    const localDate = getLocalDateFromDatetime(locale, dateTime.toString());
    return format(localDate, 'MMM d, yyyy, HH:mm a');
}
  1. Update the following lines in App/src/pages/Travel/HotelTripDetails.tsx:
    const cancellationText = reservation.cancellationDeadline
    ? `${translate('travel.hotelDetails.cancellationUntil')} ${DateUtils.getFormattedTransportDateAndHour(new Date(reservation.cancellationDeadline)).date}`
    : cancellationMapping[reservation.cancellationPolicy ?? CONST.CANCELLATION_POLICY.UNKNOWN];
      const { preferredLocale} = useLocalize();
    const cancellationText = reservation.cancellationDeadline
        ? `${translate('travel.hotelDetails.cancellationUntil')} ${DateUtils.formatLocalCancellationDate(reservation.cancellationDeadline,preferredLocale)} local time` // the translate in PR phase
        : cancellationMapping[reservation.cancellationPolicy ?? CONST.CANCELLATION_POLICY.UNKNOWN];
  1. We also need to update the travel.hotelDetails.cancellationUntil translation to 'Free cancellation – Until', or create a new translation key for it.

I'm not sure if we need to apply this change to other trips or only to hotel trip details. Currently, the expected behavior applies only to hotel trips, but we can always extend the same approach to other trip types later if needed

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

We can add tests in ReservationAddressTest or DateUtilsTest to assert that the formatted date is displayed in the correct local time format.

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Copy link

melvin-bot bot commented Apr 28, 2025

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

@melvin-bot melvin-bot bot added the Overdue label Apr 28, 2025
@laurenreidexpensify
Copy link
Contributor

@Pujan92 have you had a chance to review these proposals^^ Thanks

@melvin-bot melvin-bot bot removed the Overdue label Apr 28, 2025
@Pujan92
Copy link
Contributor

Pujan92 commented Apr 30, 2025

@laurenreidexpensify, I need help with the test spotnana account and asked about it in Slack.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Apr 30, 2025
@mallenexpensify mallenexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 2, 2025
@shubham1206agra
Copy link
Contributor

@Pujan92 Bump here

@laurenreidexpensify
Copy link
Contributor

@Pujan92 @shubham1206agra what is the latest - are you still stuck on the test account?

@Pujan92
Copy link
Contributor

Pujan92 commented May 12, 2025

Yes @laurenreidexpensify, I am trying to get access for the test account to verify from my side. https://expensify.slack.com/archives/C08CZDJFJ77/p1746036031905829?thread_ts=1745063803.789999&cid=C08CZDJFJ77

Copy link

melvin-bot bot commented May 13, 2025

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

@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 20, 2025
@melvin-bot melvin-bot bot changed the title [$250] Cancellation policy in NewDot contradicts cancellation policy in Spotnana [Due for payment 2025-05-27] [$250] Cancellation policy in NewDot contradicts cancellation policy in Spotnana May 20, 2025
Copy link

melvin-bot bot commented May 20, 2025

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 20, 2025
Copy link

melvin-bot bot commented May 20, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 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 2025-05-27. 🎊

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

  • @Pujan92 requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented May 20, 2025

@Pujan92 @laurenreidexpensify @Pujan92 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@shubham1206agra
Copy link
Contributor

Can someone assign me here as contributor?

@laurenreidexpensify
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Development

No branches or pull requests

8 participants