[PR #4303] [CLOSED] PM-10600: Re-register device with push token every 7 days. #4847

Closed
opened 2025-11-26 23:50:35 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4303
Author: @mzieniukbw
Created: 11/14/2024
Status: Closed

Base: mainHead: km/pm-10600-re-register-push-token-intervals


📝 Commits (2)

  • 5218dd1 PM-10600: Re-register device with push token every 7 days.
  • a6e22f8 PM-10600: Guarantee re-registration happens immediately on app startup.

📊 Changes

1 file changed (+47 additions, -13 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt (+47 -13)

📄 Description

🎟️ 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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/4303 **Author:** [@mzieniukbw](https://github.com/mzieniukbw) **Created:** 11/14/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `km/pm-10600-re-register-push-token-intervals` --- ### 📝 Commits (2) - [`5218dd1`](https://github.com/bitwarden/android/commit/5218dd1693064022331704f17da158add016770a) PM-10600: Re-register device with push token every 7 days. - [`a6e22f8`](https://github.com/bitwarden/android/commit/a6e22f82153bdeee52de9b4ddf44398c41fff5a3) PM-10600: Guarantee re-registration happens immediately on app startup. ### 📊 Changes **1 file changed** (+47 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt` (+47 -13) </details> ### 📄 Description ## 🎟️ 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 <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> ## ⏰ 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 <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:50:35 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#4847