"Failed to obtain primary lease"
[REQUIRED] Describe your environment
- Operating System version: MacOS 12.1
- Browser version: Chrome 96.0.4664
- Firebase SDK version: 8.10.0
- Firebase Product: firestore
[REQUIRED] Describe the problem
We're seeing this error thousands of times in production. About 10k per week.
We're seeing it on:

... I don't have a way to reproduce this reliably.
I think it might be triggered in our chrome extension as there are probably no 'tabs' there to synchronize with? At least that's a theory but it doesn't explain why it's being triggered on Firefox or Safari.
What's the cause of this issue..
We've been seeing this happen for years and have no idea what is causing it.
Steps to reproduce:
Relevant Code:
// TODO(you): code here to reproduce the problem
Just a drive-by comment. That error reporting seems to come from sentry? Might be worth posting the stacktrace that sentry gives you to help the firebase team out a bit.
It looks like our sentry isn't recording the stacktrace and we're trying to figure out why. Thanks @simeon9696
Thanks for reporting. This is the expected behavior is you have persistence enabled with the default setting and your users open multiple tabs. Only the first tab will have access to persistence - all other tabs will not be able to access it. Instead, these tabs will use memory persistence. That means that these tabs will work but will not see any local data from the first tab.
If you want to share IndexedDb access between tabs, you need to enable multi-tab synchronization. You can do this in v8 with enablePersistence({ synchronizeTabs: true }) or in v9 with enableMultiTabIndexedDbPersistence().