Mobile app homescreen collection loading 2 times on startup app

During the app startup, the data loads up and display once, then immediately it will reload and display again. Meaning two time the query is loading.

above screen has 2 queries connected, triggered automatically when input changes. Is it a bug or something I need to fix it or am i missing something?

Hey,

Does the two queries get triggered by other screens ?
Because mobile loads everything upon initial loading even if the screen might be not shown, it is possible to trigger queries twice if it is connected to other screens that is hidden.

On side note, we are working on multi screen v2 for mobile where each screen is isolated for better performance.

thank you for the reply. Each screen has specific queries. loading screen queries has triggered automatically when input changes.

One think i noticed is that, first loading on app start up will show up the old data while second immediate loading will display the latest data.

is this happening both iOS/Android and web preview ?

Possible that it shows old data due to cache.

Yes, happening in both iOS and Android.

Hi @nizaeros, I agree with @james.lee. The fact that the app is showing old data first means the queries have not run twice. If we would like to prevent this, we could render the components conditionally by checking the query.isFetching property. The value is always true while the query is running, so we could set the hidden property of the component to:

Screenshot 2024-05-08 at 11.23.55 AM