echo-swent / echo

4 stars 0 forks source link

🐛 HIGH VALUE BUGFIX AFTER 3 HOURS OF DEBUGGING: properly refetch events *after* joining/leaving event #317

Closed violoncelloCH closed 4 months ago

violoncelloCH commented 4 months ago

After spending 3 hours debugging why #313 didn't have it's intended effect when taken together with #310, I finally figured out how to make this work thanks to the help of @unglazedstamp

The refresh action being launched in it's own coroutine, it refreshed the viewmodel before the coroutine which made the call to the repository for joining/leaving (which updates the even in the cache) finished. Therefore the applied changes were not visible. This change makes sure the refresh of the viewmodel and consequently the UI state is only done after the call to the repository finished.

~:warning: requires #310 to be merged first -> only look at the last commit for now.~ EDIT: merged

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
91.7% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud