8

I am using a Firestore within Vue app.

Firestore works fine when the load is is not high

but, when I try to request around ~10k (in total) records from ~10 different collections like this:

 for (const module in dynamicModules) {
        Vue.set(state, module, []);
        bindFirestoreRef(module, db.collection(
          "tenants/" + store.state.tenantID + "/modules/" + module +
          "/records")).then(() => {
            const m = module;
        });
      }

Sometimes (not reproducable), I receive the following error:

@firebase/firestore: Firestore (7.19.0): FirebaseError: [code=resource-exhausted]: Resource has been exhausted (e.g. check quota).
@firebase/firestore: Firestore (7.19.0): Using maximum backoff delay to prevent overloading the backend.
Uncaught (in promise) FirebaseError: Failed to get document because the client is offline.

I've seen this and this topic but they don't provide an answer to the problem

I'm on the blaze plan so as far as I can see there should not be a read quota

Is this a bug or am I missing something?

Thanks

Jobias
  • 111
  • 1
  • 11
  • To move this forward to be able to reproduce your scenario, can you please provide an image of your data structure? To investigate a common issue, have you always had this issue? If not, when did it start? – MrTech Nov 09 '20 at 18:49
  • Sure: [image](https://i.imgur.com/pBuHAah.png). Structure is very easy but nested: /tenants/{tenant}/modules/{module}/records/{records} where an average tenant has 10 modules and around 2k records in each module collection. I did not always had this issue, it started a few weeks ago and it might have something to do with the fact that the record size is growing per record collection. – Jobias Nov 10 '20 at 07:39
  • I suspect the issue may be quota related. What billing plan are you using? – MrTech Nov 10 '20 at 17:38
  • As mentioned in the title and question i'm on the blaze plan with no additional quotas set up. So it should have nothing to do with a quota, because if you wait 5 min and try again it might be working perfectly. – Jobias Nov 11 '20 at 07:37
  • Sorry for the miscommunication. I'd like to search for a common issue related to your error. Can you provide a timestamp and time zone when this last occurred? – MrTech Nov 11 '20 at 19:26
  • No worries, glad that you are willing to help. Most recent one is : 2020-11-12T08:26:13.577Z in GMT + 1 And by the way, i've enabled synchronizeTabs in the PersistenceSettings [link](https://firebase.google.com/docs/reference/js/firebase.firestore.PersistenceSettings) since a few days and it seems to be more stable now. I can now easily reproduce the error when I go in chrome too: Inspect Element > Application > Clear Site data and refresh the page. I do this 3/4 times the error will pop up. – Jobias Nov 12 '20 at 08:32
  • Hello. I'm happy you have found the information. The best way to move forward, since you are reporting a bug, is to use the link (https://firebase.google.com/support/troubleshooter/report/bugs) to have this addressed. I will wait for your response. – MrTech Nov 12 '20 at 19:00
  • I've created a bug report! – Jobias Nov 13 '20 at 08:03
  • @Jobias did you ever get more information after submitting your bug report? Do you have a link to the report you can share? – Brandon Jul 02 '21 at 21:13
  • @Brandon, nope never. Was asked a lot of non sense questions, eventually I gave up . – Jobias Sep 23 '21 at 09:44

1 Answers1

0

I think you should use values change listener instead of Query . It will help , Store these values changes data in your local cache.

  • 2
    This is a workaround and doesn't work for me. I need to do some complex queries and Firestore query capabilities are too limited for my use case – Jobias Nov 09 '20 at 07:56