Skip to content

fix: Slot reservation in new booker#9769

Merged
zomars merged 4 commits into
mainfrom
fix/slot-reservation-in-new-booker
Jun 27, 2023
Merged

fix: Slot reservation in new booker#9769
zomars merged 4 commits into
mainfrom
fix/slot-reservation-in-new-booker

Conversation

@roae
Copy link
Copy Markdown
Contributor

@roae roae commented Jun 24, 2023

What does this PR do?

Bring back the slot reservation sistem to the new booker

Type of change

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

How should this be tested?

Seated event

  • Open the new booker in an event with seats
  • Select an available slot
  • Open the same event and date in other browser, the seat should be already reserved.
  • In the first browser come back to the slots views or close the booking form
  • In the second browser reload the booking page, the reserved slot should be realeased.

No seated event

  • Open the new booker
  • Select an available slot
  • Open the same event and date in other browser, the seat should be disabled

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 24, 2023

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2023 7:22pm
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2023 7:22pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2023 7:22pm
web-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2023 7:22pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 24, 2023

Thank you for following the naming conventions! 🙏

Comment on lines +78 to +88
useEffect(() => {
reserveSlot();
const interval = setInterval(reserveSlot, parseInt(MINUTES_TO_BOOK) * 60 * 1000 - 2000);
return () => {
if (eventType) {
releaseSlotMutation.mutate();
clearInterval(interval);
}
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [eventType]);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

reserve the slot on the booking form mount, and release on unmount the component

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 24, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Copy Markdown
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

@roae reserving slots should be disabled for seated events except for the last seat. Here's a link to what I've done. Could you address this in your PR?

https://github.com/calcom/cal.com/pull/9778/files#r1240959003

@roae
Copy link
Copy Markdown
Contributor Author

roae commented Jun 25, 2023

@roae reserving slots should be disabled for seated events except for the last seat. Here's a link to what I've done. Could you address this in your PR?

https://github.com/calcom/cal.com/pull/9778/files#r1240959003

Hey @joeauyeung I believe this is how it works, when select an available slot in an seated event the number of available seats should decrease
imagen

@PeerRich PeerRich requested a review from a team June 25, 2023 15:04
@PeerRich PeerRich added the High priority Created by Linear-GitHub Sync label Jun 25, 2023
@joeauyeung
Copy link
Copy Markdown
Contributor

@roae reserving slots should be disabled for seated events except for the last seat. Here's a link to what I've done. Could you address this in your PR?
https://github.com/calcom/cal.com/pull/9778/files#r1240959003

Hey @joeauyeung I believe this is how it works, when select an available slot in an seated event the number of available seats should decrease imagen

We found that the reserve system was creating bugs with seats when multiple people tried signing up.

For example, a customer sent an email blast about an event. This caused a big spike in people trying to sign up for the booking, but the reserve system was blocking multiple people trying to book the event at the same time even though there were seats available.

I think if there are multiple seats available we don't need to reserve that slot.

@roae
Copy link
Copy Markdown
Contributor Author

roae commented Jun 25, 2023

@roae reserving slots should be disabled for seated events except for the last seat. Here's a link to what I've done. Could you address this in your PR?
https://github.com/calcom/cal.com/pull/9778/files#r1240959003

Hey @joeauyeung I believe this is how it works, when select an available slot in an seated event the number of available seats should decrease imagen

We found that the reserve system was creating bugs with seats when multiple people tried signing up.

For example, a customer sent an email blast about an event. This caused a big spike in people trying to sign up for the booking, but the reserve system was blocking multiple people trying to book the event at the same time even though there were seats available.

I think if there are multiple seats available we don't need to reserve that slot.

Ok!, I get it

@ericrommel
Copy link
Copy Markdown
Contributor

@roae @joeauyeung I'm seeing a different text from what the screenshot in the description has. Could you please confirm which one is correct?
image

@roae
Copy link
Copy Markdown
Contributor Author

roae commented Jun 26, 2023

@roae @joeauyeung I'm seeing a different text from what the screenshot in the description has. Could you please confirm which one is correct? image

Hey @ericrommel both are correct, My screenshot show text in spanish

@ericrommel
Copy link
Copy Markdown
Contributor

@roae @joeauyeung I'm seeing a different text from what the screenshot in the description has. Could you please confirm which one is correct? image

Hey @ericrommel both are correct, My screenshot show text in spanish

@roae, I'm talking about the numbers there. Your screenshot shows "2 seats available" and my one shows "2 / 3 seats available".

@roae
Copy link
Copy Markdown
Contributor Author

roae commented Jun 26, 2023

@roae @joeauyeung I'm seeing a different text from what the screenshot in the description has. Could you please confirm which one is correct? image

Hey @ericrommel both are correct, My screenshot show text in spanish

@roae, I'm talking about the numbers there. Your screenshot shows "2 seats available" and my one shows "2 / 3 seats available".

yes there are differences in the translation.
could you ask in threads?, I think both are correct, lets disscuss this with @Jaibles

Copy link
Copy Markdown
Contributor

@ericrommel ericrommel left a comment

Choose a reason for hiding this comment

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

Everything looks great from my tests.

@zomars zomars dismissed joeauyeung’s stale review June 27, 2023 23:33

To be followed up

Copy link
Copy Markdown
Contributor

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

Code LGTM. Let's address seated events in a follow up.

cool

@zomars zomars merged commit 04ed36c into main Jun 27, 2023
@zomars zomars deleted the fix/slot-reservation-in-new-booker branch June 27, 2023 23:34
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Jul 25, 2023
## What does this PR do?

Bring back the slot reservation sistem to the new booker

## Type of change

<!-- Please delete bullets that are not relevant. -->

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

## How should this be tested?

<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->

### Seated event
- [x] Open the new booker in an event with seats 
- [x] Select an available slot
- [x] Open the same event and date in other browser, the seat should be already reserved.
- [x] In the first browser come back to the slots views or close the booking form
- [x] In the second browser reload the booking page, the reserved slot should be realeased. 

### No seated event
- [x] Open the new booker
- [x] Select an available slot
- [x] Open the same event and date in other browser, the seat should be disabled


## Mandatory Tasks

- [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High priority Created by Linear-GitHub Sync

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants