blonsky95 / DigiCoachAndroid

0 stars 0 forks source link

Friends is bugging again - sender doesnt get the friend back - investigate this more thoroughly #83

Closed blonsky95 closed 4 years ago

blonsky95 commented 4 years ago

Line 64 - FriendsFragmentViewModel

blonsky95 commented 4 years ago

Reset everything and test it well between 2 separate devices

blonsky95 commented 4 years ago

So this seems to be working now and I have a maybe working theory of why:

The problem was that when listening to outgoing requests, the actions to be run after the snapshotlistener is triggered weren't being succesfully called. i believe this is because the thread from which this was being called was dying or something. Now, the snapshot listener runs the actions inside a viewmodelscope.launch coroutine and it works. I guess this is because the viewmodel doesnt die like the fragment does or something like that so its thread stays alive and does the code inside to completion.

But we'll see if it works fine