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)
Tue, Feb 4, 4:26 AM
Unknown Object (File)
Mon, Feb 3, 8:24 AM
Unknown Object (File)
Sat, Feb 1, 10:13 AM
Unknown Object (File)
Thu, Jan 30, 1:55 PM
Unknown Object (File)
Jan 14 2025, 1:46 PM
Unknown Object (File)
Jan 12 2025, 7:16 AM
Unknown Object (File)
Dec 28 2024, 8:41 AM
Unknown Object (File)
Dec 28 2024, 8:41 AM
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
Branch
publish-device-token
Lint
No Lint Coverage
Unit
No Test Coverage

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

Why do we need Option?

182–192
  • 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

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