You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The javascript API reference indicates that getDocsFromCache should return an error if the documents are not currently cached. See here.
However, while using getDocsFromCache in a project today, I noticed it didn't throw any error when trying to get documents that weren't in cache. Instead it just returned the snapshot with size 0. It looks like this is intended behaviour according to this test, but does that align with the API reference? If you scroll up in that test file you'll see that getDocFromCache (singular) is expected to fail when the doc is not in the cache. Let me know if I'm missing something.
Relevant Code:
Error is never thrown, even when documents aren't in cache
letsnap;try{snap=awaitgetDocsFromCache(ref);}catch(error){// error is never thrown, code in catch block never runsconsole.log(error);snap=awaitgetDocs(ref);}snap.size===0// true
The text was updated successfully, but these errors were encountered:
sher-s7
changed the title
getDocsFromCache - Possible inconsistency between docs and source code
getDocsFromCache - Possible inconsistency between API reference and source code
Dec 3, 2022
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
The javascript API reference indicates that
getDocsFromCache
should return an error if the documents are not currently cached. See here.However, while using
getDocsFromCache
in a project today, I noticed it didn't throw any error when trying to get documents that weren't in cache. Instead it just returned the snapshot withsize
0. It looks like this is intended behaviour according to this test, but does that align with the API reference? If you scroll up in that test file you'll see thatgetDocFromCache
(singular) is expected to fail when the doc is not in the cache. Let me know if I'm missing something.Relevant Code:
Error is never thrown, even when documents aren't in cache
The text was updated successfully, but these errors were encountered: