VaggelisKa / my-desk

https://share-a-desk.vercel.app
0 stars 0 forks source link

Automatic reservations override my custom reservations for the next week #37

Open andrewCdr opened 6 days ago

andrewCdr commented 6 days ago

I have automatic reservations enabled. I change reservations for the next week, excluding one of the days. When next week comes, the day which I excluded appears to be reserved again.

VaggelisKa commented 6 days ago

Thanks for mentioning the bug here.

Having a fine-grained check for this would be a bit overcomplicated, fx

if (specificDateIsManipulated) {
  dontReserveAutomatically()
}

So i can try to think of a simpler way to work around it. Two come to mind

  1. We could run the script on the beginning of the week for the next, so you would have the chance to manually modify the upcoming week after the script has run. The problem with this might be that if someone enables auto-reservation on a Friday, then the week ahead wouldn't be booked.
  2. We could check, upon running the script, if the week has any existing reservations, if so we determine that the user has modified manually and we don't even run the auto reservation logic. The question mark with this would be if you manually book all days then remove all reservations (upon checking we wouldn't be able to determine manual modification), would you expect the script to not try to automatically reserve?