profitocracy icon indicating copy to clipboard operation
profitocracy copied to clipboard

Application Initialization Process

Open KrawMire opened this issue 11 months ago • 1 comments

Profitocracy may contain some bugs and errors which can lead to a corrupted persisted application state. As we store all the user data locally on a user's device, we can't access it directly, so we can do nothing for now if such a bug appears. So I propose to implement self-healing initialization in AppInit class while the application startup process. Here is the list of the components which should be checked before passing control to the main page:

  • Correct Profile state
  • Correctness of the all Transactions' state (may take a while, but it's better than not working application :)
  • Correct Categories' state

KrawMire avatar Apr 30 '25 23:04 KrawMire

Also, while the initialization process we can load all the data into memory. Because now we query all the data on each page navigation. For example, every time you navigate to the Transactions Page, the app queries the database to get all transactions, then maps them to a model and then renders. It would be better to create a singleton service inside the Mobile app project and load all the data there and access that loaded data from this service. So, it will be some sort of a caching layer.

KrawMire avatar Jul 21 '25 07:07 KrawMire