ThePandemoniumInstitute / botc-release

The Official Blood on the Clocktower App
https://botc.app
35 stars 2 forks source link

[BUG] Session ends when chrome prefetches url #203

Closed LordLingham closed 3 months ago

LordLingham commented 3 months ago

Description

It seems chrome is speculatively prefetching whenever i type "botc" or something similar in to my address bar. It seems this causes some auth check to happen on the app, which causes my existing session to become invalidated - meaning my active window gets logged out, and i need to login again, or just removed from the lobby

This doesn't happen "all the time", but fairly reliably

Steps to reproduce

  1. Create a private lobby
  2. Open a new tab - type "botc"
  3. See you are removed from the lobby, or logged out

https://github.com/user-attachments/assets/04b4f64d-746e-4bf4-8597-8986b76c64f5

Browser

Chrome

Operating System

Mac

Date and Time

August 13th 2024

Game Session

No response

Relevant console log output

No response

bra1n commented 3 months ago

Hey @LordLingham, this is an amazing find, thank you for the bug report! We did have a few people complain about getting logged out randomly from the app, and this might be the culprit. I'll see if I can look further into how Chrome handles these prefetch-requests to figure out a way to prevent them from kicking you out of the session.

bra1n commented 3 months ago

Alright, I think I found a fix! This will be deployed with the next update and it'll prevent the app from loading auth data in the background during a preload request.