Multiple check in of same ticket i possible using built-in QR-code scanner

  • Frans Stuurman
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 5 months ago #147515 by Frans Stuurman
While testing, I found that it is possible to check-in the same ticket multiple times, at least using Chrome on Android, Safari on IOS (iPad).
After the first scan, message is Succesfully checked in. In the back-end, check-in status is changed to checked in.
Subsequent scans on the same ticket gives message again Succesfully checked in.

Using an other ticket, I can get this situation:
First scan on device 1: Successfully checked in
Subsequent scans on device 1: Successfully checked in
Any scan on device 2: Already checked in

So scanning the same ticket on different devices gives different results.

Another thing I noticed is the following: new ticket. Scan, result Succesfully checked in (multiple times). In the back end, the registrant has status checked in. Now I check out the registrant. Scan, result Succesfully checked in. However, in the back end, the registrant keeps the status checked-out.

So, a repeated request does not reach the database. I suspect a caching issue. Resetting the browser cache helps. Both Android and iPad behave as if they never saw the ticket before.

So the question is, what can be done about that. The built-in scanner should not cache results. Is there a Joomla option for that? I disabled all caching from Joomla. It does not make any difference.

Regards Frans

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #147521 by Tuan Pham Ngoc
Hi Frans

That sound strange to me. When the same QR CODE is scanned, there should be a different message such as Registrant is already checked in, something like that

Maybe the reason is cached somehow. Could you please submit a support ticket so that we can discuss further about this issue? I would have to check it directly on your site

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Frans Stuurman
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 5 months ago #147571 by Frans Stuurman
Thank you for your offer to look further into this matter. Meanwhile i searched for places where things could be cached. I found a cause. So I think your investigation service on my server is not needed.
In my apache setup there is a declaration
ExpiresActive On
ExpiresDefault "now plus 1 hour"

This tells the browser to cache all responses from the server 1 hour.
As my server setup is quite old I forgot completely about that. But it did not cause any problem until now, and because it reduces the responsetimes from the server quite a bit I would like to keep this setting.

Anyway, some googling around gives several options:
1. Set ExpiresActive Off. Which I would not like to do
2. Use ExpiresByType, to exclude the response from the scan from caching. Inspecting the response, it has mime type text/html. So the statement would be ExpiresByType text/html 0. This is possible a workable option, as it only impacts plain text files and not the majority of the files served.
3. Have the calling javascript include a dummy parameter with a sequence number or timestamp. This causes everytime a request by a new url, bypassing the cached response from previous requests. For me this looks like a work-around, not a definitive solution.
4. Include a header with the response to disable caching of the respons.

Option 4 would be my preferred solution. As a test I setup a second domain and made a copy of my joomla. In the file scan.php, I added in the function sendJsonResponse before the echo command:
header("Cache-Control: no-store, no-cache, must-revalidate");

On my test system rescanning tickets do not result in wrong replies anymore. Inspecting the return message in Chrome does indeed show the header line, disabling the cache as intended.

I would like some solution like this included in event booking, as it is not very wel possible to exclude caching specifically server-side. Option 2 would be the best I think.
Alternatively, i might use the altered scan.php on my production system. Unfortunately, i cannot find a way to override php files which are stored in the controller directory.

Regards Frans
 

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #147581 by Tuan Pham Ngoc
Thanks Frans. In the latest package on server, I went with option #3 (workaround as you said). For now, please use that solution. I will explode your other suggested options later

For now, please access to My Downloads menu item, download latest package, upgrade it to your site and check it again

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Frans Stuurman
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 5 months ago #147595 by Frans Stuurman
Hi Tuan,

I can confirm this solves the caching problem!

Thank you for your help!

Regards Frans

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #147597 by Tuan Pham Ngoc
Great. Thanks for confirming

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc