Retrieving data from Firebase doesn't work at end of large json file

Hi, My app accesses a large Firebase json database (est. 800 primary tags, each with 4 sub-tags, one of which has an average of 5-6 sub-tags with values as text questions, i.e over 5,000 questions).
It wasn't retrieving questions in the last half or so of the json file, it just displayed a previous pick again. I verified this by moving a block of data to the beginning of the file and the retrieving worked fine.
Is there some way to give the FirebaseDB1 more time to search and retrieve correctly? Or another way to correct this issue?
Attached are some relevant blocks and database structure.
Thanks, Kris




It is not clear from your blocks....

content of global spriteTag would be something like ASAirVent or ASAlrmPressSw ?

I hope you are not calling back the entire database then making selections in the app ?

Yes, the user touches an imagesprite on a graphic and that sets the "global spriteTag" which may be e.g. ASAirVent, ASAlrmPressSw, etc. Then the equipDescription for infoLabel text is found under index 2, and the equipQuestions list for QuestionList1. Elements are found under index 1 in the json file. See screenshots of the corresponding app views.


I had another thought about what may be happening with the data retrieval. It's possible that two of the main upper level tags out of the several hundred have the same tag name. Fortunately Firebase arranges them in alphabetical order, so I should be able to see if any have duplicate tag names. Not sure if that's a problem when parsing through Firebase.

As far as I know the entire dbase isn't being downloaded.
And I checked for duplicate tag names and didn't find any.

But you say if you set spriteTag to an item that is towards the end of your firebase data, e.g. ZYAirVent, then it does not return the data?

I was confused by your mention of a large json file ? I presume this was your original data/file that you uploaded to Firebase?

Yes the json file originally uploaded to Firebase has a lot of tags. The items towards the end of the database are ones that were manually added later in the file life but don't have any alphabetical relationship, Firebase just sorts / displays them alphabetically no matter where they appear in the raw json file. Below is how the raw json file looks, the first tag chronologically was "Intro", the next , "Coupling".


Below is an example of tags that were not being retrieved, anything starting with SRU:

Having said all that, today when I reconnected the App Companion the SRU and all other items / tags that weren't working yesterday are now loading properly. I didn't change any coding!! Maybe an internal storage device like the TinyDB used by ListUtil was getting overloaded before?
I'll continue on to see if the problem shows up again, but in the meantime if not, thanks for your looking into it.

Pleased to hear it appears to have sorted itself out. Seemed unlikely that Firebase could not handle you data, not exactly a massive set of data...

Your manually added ones look OK.

Do they look the same as the others on Firebase? No extra quotes or slashes that might be interfering ?

The json file passed a json test on Json Lint and has worked fine otherwise for several years in an iOS app. Actually the whole database was manually inputted over many hours a few years back. Even the content under tags that were yesterday consistently not being retrieved are working now. Thanks, I'll re-post if the problem arises again.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.