[#132] Location is intermittently set as NULL

Migrated from Redmine #132 | Author: Sasha Verma
Status: New | Priority: High, I’m very impatient | Created: 2018-03-26


Our booking site currently has only one service and one location set up, when a user books that service sometimes the default location isn’t set, instead we get “NULL” location. However, I’ve looked at our settings and the service has a location tied to it.

Redmine Admin wrote:

please provide us raw http request and response which represent this problem

Sasha Verma wrote:

request:
curl -X POST -v -H “Content-Type: application/json; charset=UTF-8” -H “X-Company-Login: amazonscans” -H “X-User-Token: 8da390308b2169aad95882f6f58eea0e846d894014ee7aeaedaa0de94f2fb440” -d “{"jsonrpc":"2.0","method":"getBookings","params":[{"created_date_from":"2018-03-20","created_date_to":"2018-03-20"}],"id":3}” https://user-api.simplybook.me/admin/

booking with error:
{
“id”:“826”,
“record_date”:“2018-03-20 10:49:26”,
“start_date”:“2018-03-20 13:30:00”,
“end_date”:“2018-03-20 14:00:00”,
“unit_id”:“1”,
“text”:“Test User”,
“client”:“Test User”,
“unit”:“jfk20_1”,
“unit_email”:“”,
“event”:“Multi-Session Scanning Study”,
“event_id”:“1”,
“is_confirm”:“1”,
“client_id”:“294”,
“client_phone”:“+1888-888-8888”,
client_email":"researchnyc@amazon.com”,
“offset”:“0”,
“comment”:“”,
“code”:“pcamxf92”,
“location”:null
}

Dmytro Bondarev wrote:

Please provider request for book method.
The getBookings returns data which is stored in database.

Sasha Verma wrote:

We are using the simplybook.me interface, not using any API for incoming users to book.

Sasha Verma wrote:

here’s a link to the booking site

Dmytro Bondarev wrote:

if i call this raw request i get:
{“id”:“826”,“record_date”:“2018-03-20 10:49:26”,“start_date”:“2018-03-20 13:30:00”,“end_date”:“2018-03-20 14:00:00”,“unit_id”:“1”,“text”:“Test User”,“client”:“Test User”,“unit”:“jfk20_1”,“unit_email”:“”,“event”:“Multi-Session Scanning Study”,“event_id”:“1”,“is_confirm”:“0”,“client_id”:““,“client_phone”:””,“client_email”:“****”,“offset”:“0”,“comment”:“”,“code”:“pcamxf92”,“location”:“1”}
(i have replaced sensitive data)

please check your code.

Dmytro Bondarev wrote:

note that bookings can be edited by users and location can be unset.

Sasha Verma wrote:

Yes, we manually set the location later on because it was causing errors for our application requesting bookings.

Sasha Verma wrote:

We went through the process of booking an appointment to the site and it was upon the getBookings request. After noting the error, we went ahead and fixed the issue to stop our application from throwing errors around using a null location value.

Sasha Verma wrote:

Any updates?

(Short original content)

Redmine Admin wrote:

What is the problem now?

Dmytro Bondarev wrote:

Hi! We will check this issue.
But it is better not to rely on location, as it is not required value for booking.

Sasha Verma wrote:

Hmm, that doesn’t work though. If we are booking a service and it has a default location, there shouldn’t be a @null@ value. We need location for understanding where our services are booked.

Sasha Verma wrote:

Hi,
This is still causing issues for us. Services with a location attached to them shouldn’t have NULL locations.

Dmytro Bondarev wrote:

Hi! It should work correctly for recent bookings.