{"push_id":619979418,"size":1,"distinct_size":1,"ref":"refs/heads/fix-navigation","head":"9850b5553ffa595460f88b68564c40dd29c878bd","before":"0758c63a5cb78326bf7af7d72fde76e37216aff8","commits":[{"sha":"9850b5553ffa595460f88b68564c40dd29c878bd","author":{"email":"24b8c18a9c8450daa1b2c3c779902728ca24b117@gmail.com","name":"Dirley Rodrigues"},"message":"WIP: Remove SplashScreenActivity.\n\nCurrently, SplashScreenActivity is only loading the *User* object so it's\navailable to anyone who needs it. This sucks at a lot of levels, since we\ncan't guarantee that everyone who needs the User will have it, nor the User\nwill be fresh, etc. If the user opens the application through a notification\nand is presented with the MessageListFragment, for example, how can we\nguarantee that the User object is available?\n\nSo I decided that everyone who needs the User object will get it from the\nrepository.\n\nIn order to not make one request each time we need a User, we can use the\ncurrent caching APIs. Since we only have a memory cache right now, I think we\ncould implement a new Cache subclass that stores its data in the current\naccount's *user data.*\n\nFor that to work, we have to ensure that an Account exists before doing\nanything. So I decided to move the *check if an account exists* from the\nOperator to a plain Observable. This way we can do stuff like this:\n\n    ```\n    AccountUtils.getOrRetrieveAccount(this)\n                    .flatMap(account -> repository.getUser()\n                            // Cache the User in the current account!\n                            .compose(UserCache.with(this, account).cache()))\n                    .flatMap(user -> repository.getGroups(user.getCompanyId()))\n                    [...]\n    ```\n\nThis will guarantee the integrity of the data across the whole application, no\nmatter where the user starts from.","distinct":true,"url":"https://api.github.com/repos/labhackercd/edm/commits/9850b5553ffa595460f88b68564c40dd29c878bd"}]}