Saving to Local Storage and Firebase simultaneously

Hi All,
I’ve been building an App that is progressing well but have met a challenge that I’m not sure how to get around or if it is a bug / problem with the syntax?

The original build allowed all data to be saved to a userID in Firebase. This all works well until the user is offline.
To resolve this I have added a save to local storage at the same time as the save to Firebase.

Having added the local save if offline I’ve tested the new version on ThunkableLive and have observed the following annomaly:

I’ve run the routine (that saved information when the user’s head and speed changes OR on a timed bases) and the key data is saved to firebase at each waypoint however only the first 3 waypoints were saved to the local storage?

Not sure if I’ve done something wrong in the code but any support on this would be most welcome.

Thanks in advance

1 Like

Without seeing your blocks, there is no way we can advise you… it would just be a huge guess that isn’t very helpful.

This is most of it for that function

That is about the smallest screenshot I’ve ever seen. I can’t make out any of the details. You’ll need to post separate screenshots of parts of it. Or post a link to the project if that’s easier.

I looked at the project you sent.

  1. How often is the timer firing?
  2. Have you confirmed that it does fire after three saves to Firebase yet doesn’t save any new data?
  3. If you click the Waypoint button to manually save a location, does that work after three saves?

Thanks for having a look.

The timer fires in 2 different instances. Either set by the user OR if fires when the direction changes by 15deg. The waypoints are saved to firebase but only saves the first 3 to local storage? I’ve been testing in the Direction change mode but will run some tests on Timed version over the weekend?

It seems to be on the local storage side that the limit is being applied?

Sorry, I had focused on Firebase but I do see that you said local storage was the issue. I’ll take a look at the project again when I get a chance.

You’re a superstar!. Thanks

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