-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firestore iOS WKWebView unreasonable increase in application data #947
Comments
Hrm. Thanks for the report. That seems very strange and is unfortunately likely out of our control. We use IndexedDb for storage in a fairly normal way AFAIK and according to the docs you pasted, that WAL file should get deleted either on close or next open... so I have no idea why it would be growing unbounded unless there's some sort of bug in WKWebView. FWIW- By default we try to call close() the IndexedDb database on the window 'unload' event, but that's not guaranteed to fire (or have enough time to finish). So you could try adding an explicit call to Sorry I don't have anything more helpful to offer at this point. |
Thanks for suggestion
Also try to delete the file on native iOS the result was losing the saved data; while i was thinking that More Info: we are using the same environment of WKWebView at other projects using PouchDB, and didn't face any size problem before. My next step id to test Dexie JS api for indexDB on same environment and see if the size will increase or not. If anyone using WKWebView and firestore please check application data size, and feed us back if you have mentioned increase on size. |
I can confirm 99.99% the source of bug on WKWebView. Just finish testing Dexie on same environment updating 50 doc each time; after running the app 10 times i had 5MB file with only 50 docs with one field. Sent bug report to apple. |
An extra info for anyone According to what i knew that iOS Chrome using WKWebView, so i make simple page using IndexDB On my iPad just keep open and close chrome loading this page increase the Chrome Document Data by 20MB in a few minutes. It Seems Chrome on iOS facing the same problem!!!! |
We've had horrible IndexedDB for about a year now, in a Cordova app. We see no fix in sight, so our main recommendation is that people stay clear of it for now. EDIT. I should add that I've seen horrible performance in Chromium (Mac) as well, see: https://groups.google.com/forum/#!topic/firebase-talk/u1y7pYVhc48 |
@larssn And this issue was opened for iOS specific. and close it as it's related to iOS IndexedDB implementation. |
We're pretty sure its IndexedDB related. We'll do some more tests, but what we saw was this. |
@larssn I worked on tow work-around. -> for me i am using the second method, calling Hope this will help somebody and save his time |
@mohsraim I see that this is fixed in webkit (and note your question on whether it will be in the next release). https://bugs.webkit.org/show_bug.cgi?id=191294 Did you find any other workarounds to this? |
@sengoontoh the target from both solutions to free any listener on our IndexedDB while the page loaded... if we initialize the firestore directly will open IndexedDB connection and prevent GC from clearing -wal files.. iam working on second solution since few months and wait the fix to remove this button from App. |
@mohshraim I tried solution #1, waited up to 30 seconds before doing firebase.initializeApp and it still didn't clear the -wal file. Is there something else I need to do? |
@sengoontoh
on the other hand what is your environment? |
@mohshraim Appreciate the code snippet. I'm using Ionic. Deleting the app database feels slightly heavy handed to me but as you explained, maybe do it once every 50 app opens or so. Thank you so much for pushing this bug all the way through Webkit! I can't believe it has been overlooked for so long. |
@sengoontoh On the other hand i open this bug all over the world, even on chrominume, Apple Support Program.. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
We notice a huge increase on application data when use firestore on hybrid iOS WKWebView application.
Almost Each time run the iOS application an increase in application data size from 1MB to 5MB; reach 140MB in a few hours while my original Firestore DB size not more than 1 MB with less than 100 doc.
notice that on each application load we didn't read and write more than 10 docs.
To detect the increment we download the device application container through xCode; at application container we found the source of increment on the following file; IndexedDB.sqlite3-wal
and this was the location of file at container:
AppData/Library/WebKit/WebsiteData/IndexedDB/file__0/firestore%2F[DEFAULT]%2FappName%2Fmain/IndexedDB.sqlite3-wal
according to https://www.sqlite.org/tempfiles.html
Any idea?
The text was updated successfully, but these errors were encountered: