phamleduy04 / texas-dps-scheduler

Texas DPS/DMV Automatic Scheduler
MIT License
266 stars 117 forks source link

existing appointment is flagged as available and keeps being "reset" to the same date/time stopping the scheduler #148

Open abondarev84 opened 1 month ago

abondarev84 commented 1 month ago

the automatic search finds as first available the same date that I have already set and as a result it cancels existing, sets the same one and exits. updated to the latest version today.

itsmateen commented 1 month ago

change cancelIfExist to true in config file

abondarev84 commented 1 month ago

it is set to true. what happens is that it first cancels an appointment and then sets the exact same one which causes it to exit (as intended I'm guessing).

but the new and old appointments are exactly the same one (time/date/place).

phamleduy04 commented 1 month ago

sorry for the delay, do you still have logs?

phamleduy04 commented 1 month ago

Because the way the bot is coded for now is:

What I think is that 2 appointments have the same date/time that are causing issues.

abondarev84 commented 1 month ago

Since the appointment is in the past (I'm already done).
I don't know if I can test again however, what was happening is that the exact same time and date (and location of course) was being set time and time again (I had like 5 or more emails about CANCELED and then RESERVED, or whatever they send) and I didn't realize at first that it was the exact same one so I was just restarting the program to get a closer date.

I actually saved the log (just now realized)

[07/30/2024 11:50:27] WARNING -> Invalid date in config.yml, using current date
[07/30/2024 11:50:27] Texas Scheduler v3.1.1 is starting...
[07/30/2024 11:50:27] Requesting Available Location....
[07/30/2024 11:50:27] WARNING -> You have an existing booking at Austin South 08/06/2024 09:00 AM
[07/30/2024 11:50:27] WARNING -> The bot will continue to run, but will cancel existing booking if it found a new one
[07/30/2024 11:50:29] Found cached location selection, using cached location selection
[07/30/2024 11:50:29] If you want to change location selection, please delete cache folder!
[07/30/2024 11:50:29] Checking Available Location Dates....
--------------------------------------------------------------------------------
[07/30/2024 11:50:40] Pflugerville Mega Center is not Available in around 0-60 days from 07/30/2024!
[07/30/2024 11:50:45] Georgetown is not Available in around 0-60 days from 07/30/2024!
[07/30/2024 11:50:48] Taylor is not Available in around 0-60 days from 07/30/2024!
--------------------------------------------------------------------------------
[07/30/2024 11:50:51] Austin North is not Available in around 0-60 days from 07/30/2024!
[07/30/2024 11:50:58] Austin South is Available on 8/6/2024 9:00 AM
[07/30/2024 11:50:59] Slot hold successfully
[07/30/2024 11:50:59] Booking slot....
[07/30/2024 11:50:59] Canceling existing booking 172636096
[07/30/2024 11:51:00] Canceled booking successfully
[07/30/2024 11:51:02] Slot booked successfully. Confirmation Number: 133590796
[07/30/2024 11:51:02] Visiting this link to print your booking:
[07/30/2024 11:51:02] https://public.txdpsscheduler.com/?b=133590796
abondarev84 commented 1 month ago

my uneducated generic guess would be that there is somewhere a <= instead of < or something essentially similar to this.
OR that the function that compares dates and "distance" to today implicitly gets a comparison result as true when "distance" to the new appointment is the same as current one.

phamleduy04 commented 1 month ago

The bot doesn't do any comparison, will need to add this part to the code. I will fix it on the new release after #156. Thanks :)

abondarev84 commented 1 month ago

for future users :-)