timekit-io/booking-js

Create booking failed - start not defined, but it is?

Closed this issue · 8 comments

Getting this error when creating an event. As you can see in the object logline, start is definitely included in the event, but it's throwing an error saying it's not? Can provide IDs etc if you'd like
timekit

@hughstephens Thanks for reaching out!
This was actually a small bug that we by mistake introduced a few days but fixed immediately after.

Unfortunately, a deployment hiccup meant that it wasn't published correctly to all edge CDN servers. I've just redeployed it now and if you're either using our OOTB solution or are pulling the library directly from https://cdn.timekit.io/booking-js/v1/booking.min.js you should be good to go. It's also been published on npm.

Just to clarify, the error actually refers to refreshing the calendar for availability that happens after you successfully creates a booking, so booking creation isn't what's failing (but gets caught in the promises catch block)

I'll wait for your confirmation before closing the issue 👍

Hi @laander we're still getting these happening. Using https://cdn.timekit.io/booking-js/v1/booking.min.js to grab the script, but we're getting ongoing reports from customers (who won't be using a cached file I imagine…) who are telling us it's giving the "red shaking" (their words) when booking, but still booking through.

Is there something I'm missing? I can provide you steps to repro in our environment if needed.

@laander just following up here? If you recommend that we self-host booking.min.js to avoid it being cached or something we can, just need your guidance

@hughstephens I'm sorry about that. Could you contact us on Intercom (through the chat on admin.timekit.io) with reproducible steps and some more information about users/apps/bookings that might be affected?

@laander definitely still occurring with all of our users. I have just pegged us to the latest booking.min.js (by serving it locally) and ensured that all users are using the new instantiation method (we had some that were using the old one where you needed an API key and calendar param). Have started an intercom chat with examples – we are also having GCal sync issues for some of the users.

Copying in the JS we use for instantiation here as well:

var csm = {}
// just showing one example here but we use an if()else() to assign to different widgets/IDs
                            csm.name ='aaa';
                            csm.email = 'bbb'; // real email obviously
                            csm.calendar = 'ccc'; // the timekit widget ID
                            csm.photo = 'ddd'; // URL to headshot
                        window.timekitBookingConfig = {
                            widgetId: csm.calendar,
                            email: csm.email,
                            name: csm.name,
                            avatar: csm.photo || null,
                            bookingFields: {
                                name: {
                                    prefilled: "<%= practice.practiceSignatory %>"
                                },
                                email: {
                                    prefilled: "<%= practice.practiceEmail %>"
                                },
                                phone: {
                                    enabled: true,
                                    required: true,
                                    prefilled: "<%= practice.practicePhone %>"
                                },
                                comment: {
                                    enabled: false
                                }
                            },
                            timekitFindTime: {
                                filters: {
                                    and: [
                                        {
                                            business_hours: {}
                                        },
                                        {
                                            exclude_weekend: {}
                                        }
                                    ]
                                }
                            },
                            timekitCreateBooking: {
                                graph: 'instant',
                                action: 'confirm',
                                event: {
                                    what: 'Training for <%= practice.practiceName %>',
                                    where: 'Your computer - we will call on the number you gave us.',
                                    description: 'Please make sure you\'ve watched the training videos before our session. If you need to cancel or rebook your activation, call us on xxx or email yyy.'
                                }
                            },
                            localization: {
                                timeDateFormat: '24h-dmy-mon',
                                strings: {
                                    submitText: 'Book now (allow 30 seconds)'
                                }
                            },
                            callbacks: {
                                createBookingSuccessful: function (response) {
                                    console.log(response);
                                    var bookedDate = encodeURIComponent(response.config.data.event.start);
                                    console.log(bookedDate);
                                    var desc = encodeURIComponent(response.config.data.event.description);
                                    window.location.href = '<%= baseUrl %>' + '/slug/<%= practice.key %>/bookingcomplete?dateBookedFor=' + bookedDate + "&description=" + desc;
                                },
                                createBookingFailed: function(response){
                                    console.log("Create booking failed");
                                    console.log(response);
                                }
                            }
                        }

@hughstephens I've replied to our thread on Intercom; pretty sure I've found the culprit. Hope you see it soon!