Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM-10600: Re-register device with push token every 7 days. #4303

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mzieniukbw
Copy link

@mzieniukbw mzieniukbw commented Nov 14, 2024

๐ŸŽŸ๏ธ Tracking

https://bitwarden.atlassian.net/browse/PM-10600

๐Ÿ“” Objective

The Azure Notification Hub tags can change frequently, like here for Notification Center work we need to add new tags to existing devices registrations. Instead of painful migration plan, this PR adds a frequent 7 day interval re-registration of push notification for the device against Bitwarden Server.

Technical change:

  • A new coroutine is added that runs every 1 minute (scheduled job) and detects if the last time the currently stored push was sent to Bitwarden Server is older than 7 days.
    • If true, the current device is re-registered against Bitwarden Server. In normal circumstances this would have no effect whatsoever from server point of view, but in case a new tag needs to be added for Azure Notification Hub, that is being now done with this functionality.
    • If false, nothing happens.
  • On user id change (login, switch user, first app open with locked vault):
    • we run the coroutine immediately, for an edge case, that app was opened, vault unlocked and app killed immediately after (does not reach 1 minute delay).
    • the above coroutine is started with initial delay of 1 minute, for an edge case, that app is never killed and runs constantly.
  • Change the meaning of the LastPushTokenRegistrationDate, to only serve the above coroutine case.

๐Ÿ“ธ Screenshots

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

The Azure Notification Hub tags can change frequently, like here for Notification Center work we need to add new tags to existing devices registrations. Instead of painful migration plan, this PR adds a frequent re-registration of push notification for the device against Bitwarden Server.
Copy link
Contributor

github-actions bot commented Nov 14, 2024

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 6fb13240-44b0-490f-b382-9c583e5d2456

No New Or Fixed Issues Found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant