# Realtime Database Bug

**URL:** <https://community.thunkable.com/t/realtime-database-bug/651841>\
**Category:** Questions about Thunkable X\
**Created:** [July 2, 2020, 6:15pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841 "2020-07-02T18:15:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [July 2, 2020, 6:15pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/1 "2020-07-02T18:15:49Z")

</div>

Hello there,

I have noticed that when testing my apps, for some reason, the Realtime Database component only activates when the screen originally opens, when it is programmed to run every time the screen opens, could anyone tell me why this is happening?

(Screenshot of code is attached below)  
 ![Annotation 2020-07-02 131431](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/8/7812df46db13640ae37723e36087f443d529f46b.jpeg)

Best,  
Ian

---

<div class="post-metadata">

**Author:** ![chickenpotpie123](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@chickenpotpie123](https://community.thunkable.com/u/chickenpotpie123)\
**Post date:** [July 2, 2020, 7:30pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/2 "2020-07-02T19:30:00Z")

</div>

Are you using the “Live Test” feature, whether it be on your phone or on the browser itself, to test your app, or are you downloading it and testing?  
I have found that sometimes when using live testing on my phone it doesn’t save what I was working on, and I must reload the browser where I was working (on my PC) (Which then reverts the app to the last save, which usually is only a few steps behind), then it starts to catch up again.  
Hope it helps,  
chickenpotpie123

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 2, 2020, 7:35pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/3 "2020-07-02T19:35:51Z")

</div>

I have one question what kind of app is this?

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [July 2, 2020, 9:10pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/4 "2020-07-02T21:10:13Z")

</div>

This is an app that displays a list of books that you insert from Firebase.

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 2, 2020, 9:12pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/5 "2020-07-02T21:12:03Z")

</div>

I like it!

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [July 2, 2020, 9:13pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/6 "2020-07-02T21:13:23Z")

</div>

Thanks,

Im currently trying to get everything ready to publish, I will let you know when it is out.

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 2, 2020, 9:14pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/7 "2020-07-02T21:14:23Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 2, 2020, 9:16pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/8 "2020-07-02T21:16:44Z")

</div>

You know that I’m about to do that with one of mine

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [July 2, 2020, 9:17pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/9 "2020-07-02T21:17:32Z")

</div>

Nice,

What does your app do?

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 2, 2020, 9:18pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/10 "2020-07-02T21:18:49Z")

</div>

It’s like camera you have different nature filters put mine is not public

---

<div class="post-metadata">

**Author:** ![ianphaas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ianphaas/32/73941_2.png) [@ianphaas](https://community.thunkable.com/u/ianphaas)\
**Post date:** [July 2, 2020, 9:19pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/11 "2020-07-02T21:19:13Z")

</div>

Nice!

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 2, 2020, 9:19pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/12 "2020-07-02T21:19:56Z")

</div>

thanks 😇

---

<div class="post-metadata">

**Author:** ![gobassky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/gobassky/32/77019_2.png) [@gobassky](https://community.thunkable.com/u/gobassky)\
**Post date:** [July 3, 2020, 12:26pm UTC](https://community.thunkable.com/t/realtime-database-bug/651841/13 "2020-07-03T12:26:53Z")

</div>

Looks like a synchronization issue to me. The purple blocks are asynchronous blocks. You see, after the program called the realtimeDB block, before it finished fetching from the firebase and put the value into “stored book-count”, the program has gone on to process the next step which is your loop and the value of “stored book-count” is outdated.

Also, within the loop, you need to ensure that the get realtimeDB process is completed before the next iteration. You can do this by either introducing delays or (more confusing) recursive loops.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:25am UTC](https://community.thunkable.com/t/realtime-database-bug/651841/14 "2024-11-08T11:25:08Z")

</div>


