Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Swicthing screen causes bug on Firebase #1510
I currently using firebase on my project and my app already installed more than 1k so when i looking statics about usage of my firebase plan there is somethink wrong with it.
I used 12,9GB!
There is a bug and i find it.
I use Firebase database profiller tool to check database.There is no problem with my blocks.But when i switching screens its do 2x get operation for each screen switch.
When switching to other screen and if the other screen use firebase.My app try get "/" and "projectbucket" from firebase.
Here database profiller result.(its dummy database result)
NOTE: The numbers reported here are only estimates of the data payloads from read operations. They are NOT a valid measure of your bandwidth bill.
I get this result when switching between screens. Firebase is projectbucket name
So as you can see there is 2x get operation(I swithed screen 5x).And app trying get all database.My database total size is 1MB and my daily usage 400MB but my question size is 200 KB.So this bug causes hight download usage.
Please fix it :) I m going exceed my free plan again
Here my test aia.
You can seee same think with your own Firebase account and database profiller
I'm not sure that this is a bug in App Inventor. The Firebase library will attempt to retrieve existing keys that have already been requested when it connects to the DB. If you're requesting the tag from the DB, then you will get 2 copies (one automatic from Firebase on start and your request from the blocks). You might want to redesign your app so that you also use a TinyDB to check if you have already downloaded the database, and if you haven't, manually get the contents from Firebase. This will cause it to be registered for future updates (and automatic recall on restart). If your flag says you've already downloaded the contents, do nothing.
Try changing your app to use the above logic and see if you still get the double counting.
Nope ,you dont understand me.I dont need somethink like tinydb.Its just test project.I dont use any get or any other firebase block.I created this project for hunt bug.These block just added to fill my empty test project.There is a problem with Firebase.When opened x screen and if x screen has firebase its try get all data by itself.I dont use any get block when screen init or clicked button.I added buttons for change screens.
When opening screen its download all database again and again if user keep switching screens.So if database size is 1MB and if 100 switch operation happen.App download 400MB for each day.But its not correct because.I hope you understand what ı m talking about.
Problem is : If firebase added to any screen and user swtich to this screen firebase try get all database when user opened screen.I dont call any get or any other think.Maybe its about datachanged block but ı dont use it.
I succesfully downgrade my download with the new Kodular update.With the New update i can change firebase url and bucket. So i changed firebase url to firebaseurl/dummyvalue and added change firebase url to screen init block. With this litle trick firebase do not download all of my database.
Its try get dummyvalue and dummyvalue/projectbucket. This tag is empty so its not download anythink when user switching screens.Its keep increase my download usage (get request, ssl encoding..) but its not get all of my database so this trick downgrade my usage.
If App Inventor team add firebase url to block side anyone can use this