This diff introduces an update of the device's online state in the database when the ping message or the payload message write was unsuccessful.
This is a part of the stack.
Related Linear task: ENG-1766
Differential D5175
[services] Tunnelbroker - Update device online status in `Get` handler • max on Sep 19 2022, 5:57 AM. Authored by Tags None Referenced Files
Details This diff introduces an update of the device's online state in the database when the ping message or the payload message write was unsuccessful. This is a part of the stack. Related Linear task: ENG-1766 Successfully built the server and the follow-up diffs in the stack.
Diff Detail
Event TimelineComment Actions I'm checking what's wrong with the Android and iOS builds (maybe the protobuf changes broke some old client-side API code). Requesting review to unblock it for possible comments. Comment Actions would be nice to have a test case that the online behavior is being correctly updated. Comment Actions This is rather strange: for each get request we have an infinite loop of ping - is this the right approach?
Comment Actions Yes, we are sending pings to make sure the device is Online, in case the write failed we are exiting from the loop and thread and considering the device as Offline. Comment Actions Speaking of the unit tests we already have tests in D5166. To test how this algorithm behaves it can be tested by the isolated test using my repo on which I've tested this approach. Comment Actions I'm still not sure if having this logic in get is the right approach. Added a comment about it in D5174 but accepting this diff because it looks ok Comment Actions After the logic explanation in D5174 Tomek accepted the D5174, so I'm landing this one too. |