Page MenuHomePhabricator

[Tunnelbroker] add DDB column with information about invalid device token
ClosedPublic

Authored by kamil on Jul 29 2024, 1:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 11:03 PM
Unknown Object (File)
Sat, Nov 2, 3:44 AM
Unknown Object (File)
Sat, Oct 19, 8:24 AM
Unknown Object (File)
Fri, Oct 18, 9:46 PM
Unknown Object (File)
Fri, Oct 18, 9:45 PM
Unknown Object (File)
Fri, Oct 18, 9:45 PM
Unknown Object (File)
Oct 6 2024, 8:43 PM
Unknown Object (File)
Sep 26 2024, 12:33 PM
Subscribers

Details

Summary

ENG-8498.

This approach allows us to:

  1. Avoid attempting to send notifications to the provider multiple times even if the device token is invalid.
  2. Avoid queuing up a lot of messages to a device that the token is invalid, we can do it only once.

The alternative is deleting the device token but then it's complicated to distinguish if the token was invalidated or the device is logging to Tunnelbroker for the first time.

Depends on D12887

Test Plan

Test if getting the device token works, rest is tested later in the stack,

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil edited the test plan for this revision. (Show Details)
kamil published this revision for review.Jul 29 2024, 6:20 AM
kamil added a reviewer: tomek.
bartek requested changes to this revision.Jul 29 2024, 7:26 AM

This can be simplified and a bit more stable

services/tunnelbroker/src/database/mod.rs
41 ↗(On Diff #42860)

Why do we need Option?

182–192 ↗(On Diff #42860)
  • take_attr() supports Option<T> - it returns None if the DDB attribute doesn't exist
  • This way, failure due to parsing errors (DBItemError) is distinguishable from non-existing attribute
services/tunnelbroker/src/websockets/session.rs
535–547 ↗(On Diff #42860)

Assuming you changed type from Option<bool> to just bool:

This revision now requires changes to proceed.Jul 29 2024, 7:26 AM

Thanks for suggesting, makes more sense now

This revision is now accepted and ready to land.Jul 29 2024, 8:07 AM