Open Zafouche opened 2 days ago
I'm currently testing offline features from scratch, I will list in this comment what I find:
We should decide if we want to allow a user to create an event while offline. If we do, that means we should allow the user to give, to the location input, whatever he wants to write in. This means the user can also choose not to write an address, and put in whatever word or sentence they want. In offline mode, it wouldn't be possible to restrict this input field to a Location
, which is pretty central to an Event
, or else how would we know where the event is.
Either we allow the user to create an event w/o a location, just disallow the user to create an event w/o connection, or trust the user to put an actual address in the location field. [TO DISCUSS]
Home
Screen: a search query takes anywhere from 30-60 seconds personally. It looks like there might be caching issues, or the data is not properly stored, but whatever it is, it makes the search queries muchhhh slower.Explore
Screen: similar to the Home
Screen. From my testing, it took a minute for the first query, then 5-10 seconds for the second query, then 20 for the third,... Basically, it's also way too long. Seems there might be an issue with where or how the search view model gets its data. Check the implementation of the whole search bar mechanism.
While trying to use the search bar on the Explore screen, I noticed we cannot close the search bar's drop down menu by clicking elsewhere. We HAVE to click on a search result, but then it takes us to that result's association profile. This behavior should be fixed, and we should allow the user to close the drop down by clicking elsewhere on the screen.
Nothing is shown and the map doesn't load when we are in offline mode. This is because, from my research, the free google cloud service does not allow its API users to store the map offline: Maps premium enterprise API is required, meaning you have to pay.
EDIT: I hadn't loaded the map screen before cutting off the connection. It turns out, if we start the app with wifi, load the map once, then the map is cached on the phone. However, since Google's cloud services doesn't allow to download it, the map cache will be emptied after closing the app. But if we have loaded it, and cut off connection after that, we can load back in and browse through the map with no problem.
Switch to Open Street Map. I think we should do this, as having the events on the map could be useful. Although the user can still see their addresses in offline mode, and use the default maps app of the phone for GPS, we should consider this for optimized user experience. OSM gives the possibility to do this.
When we press the heart
button to save an event, it takes 3-4 seconds for it to be processed and show up in the Saved
screen.
Not sure. The backend of the saving mechanism needs to be investigated to determine what causes it to be slow. But it works! But its slow.
MyProfile
screen automatically. However, the description is successfully modified, and I can see my new description when switching screen manually by clicking on the Back
button. So it works, but this behavior should be fixed.When we gain back connection, it indeed uploads to changes made in offline mode to firebase, so that's great!
Check Edit
profile UI logic, and the button / navigation mechanism.
MyProfile
screen.Other than the above, the rest of the available features all work. We can browse through events and the explore screen, we can check out the specific event screen and association profiles, etc.
I will keep this issue open so that we can give updates directly to this issue when we fix something.
Give your opinions here, and take your pick of what you want to fix if it's not a problem that we need to discuss the solution for!
Edit: actually, I'll break these different issues into their own tasks, such that the discussions do not overlap.
A couple of issues were raised in this issue:
Offline mode should work everywhere in the project, in theory(read and write queries). However I noticed that some operations do not work in offline mode:
ConcurrentAssociationUserRepositoryFirestore
, which runs the calls in arunBatch
. I suspect this batch operation is the issue, and has to be handled differently to work with offline mode, or another operation should be done after to fix the bug. [HANDLED]