Implement device token and device name update from mobile feature#25
Open
VihangaMunasinghe wants to merge 10 commits into
Open
Implement device token and device name update from mobile feature#25VihangaMunasinghe wants to merge 10 commits into
VihangaMunasinghe wants to merge 10 commits into
Conversation
…e device handler to use new method
…eValidator claims validation
This was referenced May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Add support for editing/updating device properties (device name and device token) from mobile devices. Currently, once a device is registered for push notifications, there is no way to update its name or FCM token from the mobile side.
Related Issue
Related PRs
Goals
DeviceHandlerServiceinterface.Approach
editDeviceMobile(String deviceId, String token)method toDeviceHandlerServiceinterface and its implementation inDeviceHandlerServiceImpl.PushChallengeValidator.getValidatedClaims(), extracts the updated device token and/or device name from the validated claims, and persists the changes.getValidatedClaims()method toPushChallengeValidatorthat returns JWT claims as aMap<String, Objectfor easier consumption.EDIT_DEVICESQL query constant and related claim constants (DEVICE_EDIT_REQUEST_DEVICE_TOKEN,DEVICE_EDIT_REQUEST_DEVICE_NAME) toPushDeviceHandlerConstants.handleUpdateDeviceForProvider()to keep the push provider (e.g., FCM) in sync.User stories
As a mobile app user, I want to be able to update my device's push notification token or device name so that push notifications continue to work correctly after token rotation or when I rename my device.
Release note
Added support for editing device name and device token from mobile devices in the push notification device handler. Edit requests are validated using JWT token verification.
Documentation
N/A - This is an internal API change for the push notification component. API documentation should be updated when the consuming REST API layer exposes this functionality.
Training
N/A
Certification
N/A - Internal component change with no direct impact on certification content.
Marketing
N/A
Automation tests
PushChallengeValidator.getValidatedClaims()covering valid token, blank token, invalid JWT, expired token, invalid signature, and claim value verification scenarios.DeviceHandlerServiceImpl.editDeviceMobile()covering successful device update, device not found, token validation failure, missing edit fields, and class cast exception scenarios.N/A
Security checks
Samples
N/A
Migrations (if applicable)
No migrations required. The
EDIT_DEVICESQL operation uses existing database columns.Learning
Leveraged the existing
PushChallengeValidatorJWT validation pattern and extended it to support returning claims as a Map for more flexible claim extraction in the device edit flow.