-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Expected behavior (required)
When I navigate to a page that has a widget whose data is derived from an api query (as described here), I expect one request sent to the api backend to populate the widget.
Current behavior (required)
If I navigate to a page N times, the Nth time I go to the page, N queries are triggered for the widget. Additionally, any action that causes the page to redraw, N more queries are triggered for each redraw. It's really easy to cause this behavior -- and also appears to happen in the flutterflow app itself, from any project page (e.g., https://app.flutterflow.io/project/$YOUR_PROJECT). In chrome, you can open the network inspector, resize the window, and see the mountain of queries sent to firebase.
To Reproduce (required)
Create an app with two pages, one of the pages having a widget that is derived from an api call. Navigate back and forth between the pages a few times and then open up the network inspector (assuming chrome web). Each time you navigate to the page with the api-backed widget, instead of a single request, you will see one request for each time you've navigated to the page. What's worse, if you resize the network inspector, all those queries get retriggered each time the page is redrawn.
I was able to quickly trigger 1000+ queries to firebase from your app just by clicking between pages and then resizing the window a couple of times.
Context (required)
This causes clients to issue massively more queries than they need to, easily beating up backends handling expensive queries.
Screenshots / recordings
^ above, I cleared the network inspector in chrome and resized the window for a few seconds and caused over 600 queries to hit your firebase backend.
Your environment
- Bug Report Code:
- Version of FlutterFlow used: v3 October 5, 2022
- Platform (e.g. Web, MacOS Desktop): web (chrome)
- Browser name and version: chrome (106, but appears to be any recent version). Looking at the generated code, I expect this to happen on all platforms.
- Operating system and version (desktop or mobile): windows 11
