firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.85k stars 892 forks source link

App Check works at first but fails to reconnect after sleep/background #8520

Closed AmilKey closed 1 month ago

AmilKey commented 1 month ago

Operating System

Mac OS

Environment (if applicable)

Chrome 129

Firebase SDK Version

10.13.2

Firebase SDK Product(s)

AppCheck

Project Tooling

firebase 10.13.2 Ember.js 5.9.9 "firebase-admin": "^12.5.0", "firebase-functions": "^6.0.1",

Detailed Problem Description

When leaving the webapp tab open and idle, the app often runs into a 403 error in POST request to exchange AppCheck token ("App attestation failed." "PERMISSION DENIED"), followed by a warning: @firebase/app-check: AppCheck: Requests throttled due to 403 error. Attempts allowed again after 01d:00m:00s (appCheck/throttled).

I see a lot of issues here but I can't find how to resolve this problem

https://github.com/firebase/firebase-js-sdk/issues/6708 https://github.com/firebase/firebase-js-sdk/issues/6373 https://github.com/firebase/firebase-js-sdk/issues/7371 https://github.com/firebase/firebase-js-sdk/issues/7779

the best solution I see is not to use the App Check service at all

Steps and code to reproduce issue

Change the App Check TTL in the console to 30 minutes.

Sleep mode: Leaving the website open in a browser on a notebook that goes into sleep mode without shutting down. Upon resuming, the 403 error is present.

google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

hsubox76 commented 1 month ago

Duplicate: https://github.com/firebase/firebase-js-sdk/issues/8200