Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On some loads, it never realizes an admin may edit cards #690

Open
jkomoros opened this issue Mar 31, 2024 · 3 comments
Open

On some loads, it never realizes an admin may edit cards #690

jkomoros opened this issue Mar 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jkomoros
Copy link
Owner

Seems to be happening more with 13k cards in production. After a few refreshes, one of them will notice that the user has editor permissions.

@jkomoros jkomoros added the bug Something isn't working label Apr 3, 2024
jkomoros added a commit that referenced this issue Jun 23, 2024
When that happens today, as happens reasonably often in #690, this swallows the error and makes it harder to debug.

There shouldn't be an error under normal flows I don't think, and if the permissions doc doesn't exist the snapshot will have an exists() false, and return undefined from data(), which is already handled.
@jkomoros
Copy link
Owner Author

An example error when this happens:

card-web-app-b8587828.js:1 [2024-06-24T14:56:43.457Z] @firebase/firestore: Firestore (10.11.0): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
r @ card-web-app-b8587828.js:1
error @ card-web-app-b8587828.js:1
Nc @ card-web-app-b8587828.js:1
w
@ card-web-app-b8587828.js:1
(anonymous) @ card-web-app-b8587828.js:1
(anonymous) @ card-web-app-b8587828.js:1
(anonymous) @ card-web-app-b8587828.js:1
(anonymous) @ card-web-app-b8587828.js:1
Promise.then (async)
hu @ card-web-app-b8587828.js:1
enqueue @ card-web-app-b8587828.js:1
enqueueAndForget @ card-web-app-b8587828.js:1
handleDelayElapsed @ card-web-app-b8587828.js:1
(anonymous) @ card-web-app-b8587828.js:1Understand this error
card-web-app-b8587828.js:1 Uncaught (in promise) FirebaseError: Failed to get document because the client is offline.

@jkomoros
Copy link
Owner Author

A few things to try:

  • pagination
  • enableIndexedDbPersistence(firestore, persistenceSettings)
  • enableMultiTabIndexedDbPersistence(firestore)
  • bundles for cards that haven't been modified in a very long time

jkomoros added a commit that referenced this issue Jun 29, 2024
This is a temporary hack to get around the very-long-load time for unpublished cards leading to firestore erroneously thinking the storage is down.

Part of #690.
@jkomoros
Copy link
Owner Author

#665 seems related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant