Ah ha, here I come back again. I have been trying to deal with constant app crashes and now, to my surprise, a serious problem with Firebase.
I made a button to mass update some values on a Firebase database. I click the button and rush to Firebase screen, where I can see every data being update, one by one. Just like a dream… But it becomes a nightmare when after some time, I look again at all my data and I realize that all the update I made has been REVERTED as if I had never done anything.
The original data was updated to Firebase from a JSON list (made in Excel). The only thing I change in the list is the field BOX. To do so, I have this code below:
Everytime I update this field, I check FIREBASE and everything is perfect. After some time I look back and this action has been reverted… Today it happened 3 times to me.
Could it be a problem with cache or some kind of memory?!
The code is really working, the problem is that it undo later. I have to other task to mass call the database.
I think the problem is not in FireBase, but in the algorithm. From your blocks, I see that you are in a loop trying to work with asynchronous get and set methods using the synchronous approach and delay. Such an algorithm is an excellent source of permanent errors.
What problem do you need to solve?
Do you see the “error” block in the Get and Save methods? This block is used to track errors, but your code ignores the occurrence of errors and continues to call these methods in a loop.
Do you understand how the work of asynchronous blocks differs from synchronous?
Yes, in fact I have to put some delay, otherwise it skips the whole task without acomplishing anything.
My code ignore errors! I really don’t know how to use this error block. What would you advise me to treat this error? Do you have any example for me to take a look?
Unfortunately, I do not have a ready-made example yet, but Mark showed an example of working with an asynchronous block.
I do not know your final task, but I would consider the option when we first prepare all the data to write to FireBase, and then save it with just one call to the Save method.
Wow, thank you so much for this link you sent me. It really clarified my mind. I had no clue of the problem and as I am not a programmer or anything related to IT, I don’t know how to debug. This is the 4th “bug”/“limitation” I come across here on Thunkable.
It would be really good if these limitations were directly updated in the manual. I was almost giving up of my project…
Thank you once again.