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

Fix minimum booking notice set to 0 #7750

Merged
merged 9 commits into from Mar 25, 2023
Merged

Fix minimum booking notice set to 0 #7750

merged 9 commits into from Mar 25, 2023

Conversation

joeauyeung
Copy link
Contributor

What does this PR do?

This PR, solves the "Booking out of bounds" error when minimum notice was set to 0

Fixes # (issue)

Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • In an event type, set the minimum booking notice to 0 under the "Limits" tab
  • Go to the availability page. It should load

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't performed a self-review of my own code and corrected any misspellings
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my PR needs changes to the documentation
  • I haven't checked if my changes generate no new warnings
  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

@joeauyeung joeauyeung requested a review from a team March 15, 2023 15:17
@vercel
Copy link

vercel bot commented Mar 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 20, 2023 at 5:32PM (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 20, 2023 at 5:32PM (UTC)

@@ -133,10 +133,7 @@ export const SlotPicker = ({
eventTypeId: eventType.id,
eventTypeSlug: eventType.slug,
usernameList: users,
startTime:
browsingDate === undefined || browsingDate.get("month") === dayjs.tz(undefined, timeZone).get("month")
? dayjs.tz(undefined, timeZone).subtract(2, "days").startOf("day")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the cause of the "bookings can't be made in the past" error. For example, if it is March 15th 3 pm, when looking for slots the start date would be March 13th 3 pm. This fails the isOutOfBounds check. Why was there a reason we started slots 2 days in the past?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roae may have more context of this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not sure why that is done that way, I kept it because of that, I guess, it subtracts that time for utc- time zones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zomars with @roae's comment are we good to go?

browsingDate === undefined || browsingDate.get("month") === dayjs.tz(undefined, timeZone).get("month")
? dayjs.tz(undefined, timeZone).subtract(2, "days").startOf("day")
: browsingDate?.startOf("month"),
startTime: dayjs().startOf("day"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just use the current day and determine the availability from that. It wouldn't fail the isOutofBounds check since it compares it to new Date()

@github-actions
Copy link
Contributor

github-actions bot commented Mar 15, 2023

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

Eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user]/[type] 99.78 KB 310.67 KB 88.76% (🟢 -0.01%)
/[user]/[type]/embed 99.81 KB 310.69 KB 88.77% (🟢 -0.01%)
/booking/[uid] 131.41 KB 342.29 KB 97.80% (+/- <0.01%)
/d/[link]/[slug] 99.43 KB 310.32 KB 88.66% (🟢 -0.01%)
/d/[link]/[slug]/embed 99.46 KB 310.35 KB 88.67% (🟢 -0.01%)
/event-types/[type] 386.38 KB 597.26 KB 170.65% (+/- <0.01%)
/team/[slug]/[type] 99.43 KB 310.32 KB 88.66% (🟢 -0.01%)
/team/[slug]/[type]/embed 99.46 KB 310.35 KB 88.67% (🟢 -0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@deploysentinel
Copy link

deploysentinel bot commented Mar 15, 2023

Current Playwright Test Results Summary

✅ 66 Passing - ⚠️ 1 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 03/20/2023 05:44:44pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: bcb0a8c

Started: 03/20/2023 05:36:38pm UTC

⚠️ Flakes

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests user can add multiple organizer address
Retry 1Initial Attempt
7.78% (20) 20 / 257 runs
failed over last 7 days
33.46% (86) 86 / 257 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and worked 🙏🏽

@zomars zomars merged commit 20022e2 into main Mar 25, 2023
@zomars zomars deleted the slot-picker-start-of-day branch March 25, 2023 00:37
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants