home-assistant / home-assistant/iOS
iOS app document & data storage size will randomly grow very large
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 520
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 264
Description
**iOS device model, version and app version**
Model Name: iPhone 14 Pro (Noticed this issue on iPhone 11 too)
Software Version: iOS 16.0.1 (Noticed this issue on iOS 15)
App version: 2022.8
**Home Assistant Core Version**
2022.9.6 running on home assistant OS 9.0. Issue was definitely present on previous versions.
**Describe the bug**
Although I cannot pinpoint what causes this to start but once noticed the issue only goes away if the app is deleted and reinstalled although it seems to return. Specifically the "Documents and Data" storage size for the home assistant app grows very large and remains around this size, in my case this will be around 780MB. Deleting the front end cache, location history and event log seems to have no affect. Total size of the zipped logs are around 17MB but nothing relevant that I can see.
**To Reproduce**
Normal use of the app, nothing specifically relevant in the logs.
**Expected behavior**
Seems it shouldn't grow so large.
**Screenshots**


**Additional context**
I was able to use a 3rd party tool to take a backup of the app and extract it from my phone. It seems that of the ~780MB the majority of it is coming from a file called "store.realm" in the dataStore directory (726MB). My understanding is this is potentially created by this https://github.com/home-assistant/iOS/blob/master/Configuration/Podspecs/Realm.podspec.json
I used a tool (https://studio-releases.realm.io/) to open and examine the contents of this file but of the visible data I cannot see how it could come close to 700+MB so it seems potentially there is some corruption?
Not having much experience with ios development I am not sure how relevant this is but this old issue https://github.com/realm/realm-core/issues/2343 seems to have multiple more recent and potentially relevant links.
Contributor guide
Assessment
This issue has not been assessed yet.