I found what is probably a subtle bug. It happened twice

I found what is probably a subtle bug. It happened twice and it was very difficult to detect.

What happens is the following: one of my staff is inserting an apointment in the admin panel, saves and everything seems correct, the customer is notified by email. After a few time my staff checks the appointment in the admin panel and they discover it disappeared. No evidence of that appointment.

Digging in the log and in the appointment table in the DB I discovered that the appointment ID of the original appointment exists, but it has been overwritten by another appointment, so with completly different data. The log shows that another appointment was beeing taken in the front-end by a customer, just 1 minute later. What happened is that the new appointment was saved with the same appointment ID, so deleting the old appointment and saving the new one.

As a result the old appointment do no more exist and the new appointment is present in the DB. All info about the old apointment were lost.

Here's the log:

[07/12/2014 02:22] Confirmation message sent to marino.malavolti@alice.it for appointment ID:631
[07/12/2014 12:29] Confirmation message sent to anna_dm1960@libero.it for appointment ID:496
[07/12/2014 13:51] Confirmation message sent to pamyx@inwind.it for appointment ID:431
[07/12/2014 13:52] Confirmation message sent to anna_dm1960@libero.it for appointment ID:496
[07/12/2014 15:07] Confirmation message sent to ambra.ceruti@gmail.com for appointment ID:633
[07/12/2014 19:27] Confirmation message sent to mrc000777@hotmail.it for appointment ID:635
[07/12/2014 20:14] Confirmation message sent to alexsaca_ct@yahoo.com for appointment ID:636
[07/12/2014 20:15] Confirmation message sent to philippobarbieri@gmail.com for appointment ID:636
[07/12/2014 20:21] Confirmation message sent to philippobarbieri@gmail.com for appointment ID:636
[07/12/2014 20:50] Confirmation message sent to philippobarbieri@gmail.com for appointment ID:636
[07/12/2014 21:28] Confirmation message sent to stefano.coronella@tim.it for appointment ID:639
[07/12/2014 22:02] Confirmation message sent to clarissagarcia85@yahoo.com for appointment ID:640
[07/12/2014 22:17] Confirmation message sent to valerio.bamberga@gmail.com for appointment ID:552
[07/12/2014 22:17] Status changed from removed to paid by silvia for appointment ID:552

As you can see appointment 636 was completed at 20:14 and an email sent to the client.

After 1 minute (20_15) the appointment 636 was saved again for a different customer, and an email sent to the new customer. All data of the old customer were lost.

The same problem occurred a few weeks ago.

It seems the software has some kind of problems when two or more appointment are taken in the same moment.

This is obiously a BIG problem for us, as it's causing loss of appointments and customer data. And most of all make the system appear instable.

So please, make all what is in your possibility to direct this bug to developpers and mark it as blocking.

I'm available for more information.

Kind regards

Antonio

  • Bojan Radonic

    Hey there @Antonio, hope you're well today.

    I've tested this on my installation and what ever I tried I kept getting message that the appointment slot has been taken.

    Before forwarding this to plugin developer could you please grant us access to your admin so we can do some testing and possibly try to recreate this. You can do that by clicking "Grant Access" button in the WPMU DEV Dashboard Settings from the following path and reply on this thread after granting it?

    Admin -> WPMU DEV -> Support -> Support Access > Grant Access

    If you have not installed WPMU DEV Dashboard plugin yet, kindly do that here : https://premium.wpmudev.org/project/wpmu-dev-dashboard/ and then allow access as per the above process.

    Best regards,
    Bojan

  • Antonio

    Hi Bojan,

    I created a staging copy of my site at staging1.adventurerooms.it and granted access.

    I'm trying to replicate the problem myself, but this is not easy. What is sure is the problem exists, as you can check in the log.

    I was able to replicate another problem, different from the previous one, but also very important, as it generates two appointment in the same date/hour

    - On the frontend select a date/time, fill the form and go to paypal (sandbox)
    - On the backend create a new appointment for the same date/date
    - Complete the paypal payment

    This will result in two different appointment for the same date/time.

    Generally speaking the admin panel does not check if there are same appointments for the same date/time, which will result in duplicated appointment.

    I suppose this is a bug too. But it's different from the previous one, where only one app ID is created but the previous one is overwritten.

    I will keep trying to replicate the error too.

    Please update me.

    Antonio

  • Antonio

    I finally could reproduce the bug.

    Here's how:
    - Open admin, create a new appointment for a specific date/time but don't save it
    - Open the front-end in a new browser tab and create a new appointment for the same date/time. Complete the paypal payment (sandbox). The appointmnet is saved and the customer receive the confirmation email.
    - Now go back to the admin and save the appointment you previously created. The appointment is saved overwriting the appointment taken on the front-end with the SAME ID. The new customer receive a confirmation email and the appointment for the old customer is gone forever !

    I suppose this bug is strictly connected the the previous one.

    The first one creates two appointment for the same date/hour.
    The second one overwrites the first appointment with the second one.

    Please let me know ...

    Kind regards

    Antonio

  • Vinod Dalvi

    Hi Antonio,

    Thank you for your reply.

    I tried to reproduce the issue as you have described but i couldn't reproduce the issue as displayed in the attached screenshot.

    Could you please send me your site staging1.adventurerooms.it details as described in the following reply on your another thread so that i can troubleshoot it?

    https://premium.wpmudev.org/forums/topic/appointment-lower-limit-not-working-as-expected#post-792643

    Regards,
    Vinod Dalvi

  • pxwm

    Hi @Bojan and @Vinod Dalvi - I hope you don't mind me chiming in.

    Hi @Antonio

    Based on your further post that you had managed to replicate the problem by entering an appointment in the backend as Admin but not saving and then making an appointment in the front end and then going back to the backend as Admin and saving.

    Then I would suggest this isn't a bug as my understanding is that logged in as Admin and making appointments in the backend allows you to double book appointment slots. You have to be extremely careful booking appointments via the backend as Admin as there aren't any checks to confirm if you are double booking slots as there are in the front end.

    If possible I would always recommend making bookings, even as Admin through the front end.

    However I would appreciate if you could confirm the following in your further example because this seems slighly different to your original example/problem.

    When you selected an appointment slot in the backend as Admin and didn't save, then booked the same slot from the front end and then went to the backend as Admin and saved the appointment did this overwrite the appointment made from the front end?

    Regards
    SteveB

  • Antonio

    Hi everybody.

    For @Vinod Dalvi: I sent the login/pw to the staging site as you suggested, so you can check there.

    For @Pxwm: actually I cannot agree with your opinion. According to my point of view this IS a bug, and my staff is having great problems with it. They don't know they are double booking, they are sure they're single booking, but the result is a twin appointments for the same date/time or the overwriting of a previous appointment.

    Let me clarify the first and the second problem, as they are quite different:

    PROBLEM 1 - OVERWRITING OF APPOINTMENT

    Staff is creating a new appointment in the admin, but meanwhile a customer creates an appointment in the front-end for the same date/time. When staff finishes to create the appointment in the admin this one averwrites the appointment created in the front.

    To recretate the problem:
    - Open admin, create a new appointment for a specific date/time but don't save it
    - Open the front-end in a new browser tab and create a new appointment for the same date/time. Complete the paypal payment (sandbox). The appointmnet is saved and the customer receive the confirmation email.
    - Now go back to the admin and save the appointment you previously created. The appointment is saved overwriting the appointment taken on the front-end with the SAME ID. The new customer receive a confirmation email and the appointment for the old customer is gone forever !

    PROBLEM 2 - DOUBLE APPOINTMENTS

    In this case Staff is creating an appointment in the Admin while a customer is already creating an appointment for the same date/time. The Staff saves the appointment and afterward the customer completes the payment. This result in two appointments for the same date/time. In details:

    - On the frontend select a date/time, fill the form and go to paypal (sandbox)
    - On the backend create a new appointment for the same date/date
    - Complete the paypal payment

    I suppose both problems are tied to how the admin panel creates a new APP-ID and blocks it. It seems that admin panel and front-end does not compete for the APP-ID.

    Thanks for support.

    Kind regards

    Antonio

  • pxwm

    Hi @Antonio

    Many thanks for your feedback.
    I was only trying to indicate that my understanding is that currently there isn't any validation if an appointment is booked through the backend by Admin.
    I agree it would nice if it did but currently my understanding is that it doesn't.

    Is there any reason why Admin can't book the appointments through the front end because this should resolve your issue with double bookings as the appointments are validated and if two people tried to book the same free slot at the same time then a message will be presented to one person stating that the slot isn't available when they click 'submit'

    I hope this helps
    Regards
    SteveB

  • Antonio

    Hi @pxwm,

    thanks for your reply.

    Yes, like you I also think there's no form of validation of app IDs booked from the admin, in other words there is no synch between admin and front-end. You say that it would be nice to have, my opinion is this is a serious bug and I hope A+ developpers will consider it for a fix.

    In the meantime what you suggest (booking from the front-end) is surely a viable workaround.

    But I really would like to see the admin as stable and issue-free as the front-end.

    Thanks again

    Antonio

  • Vaughan

    Hi Antonio,

    I have flagged the developer for you, whilst I don't think this is a bug myself, I can understand how you feel it is a bug, this scenario wasn't ever envisaged before & it's the first time we've ever had a report of this kind.

    However, the developer will definitely look into this and see if we can get this looked at so it can be prevented from happening, this could take a little longer to do though as apps+ is quite a complex plugin, but hopefully it shouldn't take too long.

    In the meantime though, I can only suggest that you ask the admins to book from the front-end & only use the admin for editing already booked appointments so you can avoid these collisions until we get this sorted.

    Appreciate your understanding & apologies for the inconvenience.

    Thanks

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.