playfinder / openactive

A place to submit issues with the Bookteq Openactive feeds
0 stars 0 forks source link

Lease at C2 does not always update the availability feed #5

Open nickevansuk opened 9 months ago

nickevansuk commented 9 months ago

There appears to be a race condition where the lease at C2 does not always update the availability feed. In these cases, the feed is successfully updated after the B call.

Examples of various failing tests due to this are below:

nathansalter commented 7 months ago

@nickevansuk I believe this issue is fixed now for imin.bookteq.xyz

lukehesluke commented 1 week ago

@nathansalter I've just seen this issue also.

Here's an example for named-leasing >> lease-response:

named-leasing_lease-response_OpenBookingSimpleFlow_IndividualFacilityUseSlot.html.zip

The test was expecting an update to the Opportunity feed with remainingUses set to 0, but it timed out waiting for it. Several minutes after the test stopped, I queried Broker to see if the Opportunity feed had yet updated, and it showed that the opportunity was still at remainingUses: 1. Here's that request:

GET 'http://localhost:3000/opportunity/https%3A%2F%2Fimin.strmln.uk%2Fapi%2Fopen-active%2Fa7533eed-b15c-469f-a05f-604737b9acd5%2Fslots%2F0904f6a5-e5b8-57ec-acfc-eb1e076ef4e2?useCacheIfAvailable=true'

http%3A%2F%2Flocalhost%3A3000%2Fopportunity%2Fhttps%253A%252F%252Fimin.strmln.uk%252Fapi%252Fopen-active%252Fa7533eed-b15c-469f-a05f-604737b9acd5%252Fslots%252F0904f6a5-e5b8-57ec-acfc-eb1e076ef4e2%3FuseCacheIfAvailable%3Dtrue.json

The issue seems to be temperamental. I've noticed that it causes something like ~25% of tests that involve calling C2 to randomly fail, as Test Suite always makes this check after a C2 call.

Probably the same issue

This test bypasses C2, but has a similar issue. It seems reasonable that they could have the same root cause:

free-opportunities_opportunity-free-without-checkpoints_OpenBookingSimpleFlow_IndividualFacilityUseSlot.html.zip

The 1st B response shows remainingUses: 1 and the 2nd shows remainingUses: 0, which is why the test fails


User experience impact: Depending on what the issue is here, either of the following could happen: 1). It's possible to book a space that has been leased; or 2). A Slot may look like it has spaces, but then booking fails when a user attempts to book it

nathansalter commented 2 days ago

Might be worth keeping an eye on this, might have to have a look at what's happening here. Otherwise exclude from the test suite