notifications icon indicating copy to clipboard operation
notifications copied to clipboard

refactor(push): make encryption/signing more robust

Open joshtrichards opened this issue 1 month ago • 0 comments

This PR improves how push notification signing errors are handled to prevent sending unsigned notifications (which clients would reject anyway) and ensures clear, consistent error management.

  • Signing problems are consistently checked and logged cleanly.
  • Longer subjects are truncated to fit cryptographic limits, and truncation is now logged (debug level).
  • Unit tests have been added for the new error handling logic.
  • Code has been refactored for greater consistency and clarity.

Note:

  • Adds a PushSigningException for signing failures; affected devices are skipped, not deleted.
  • Device tokens are still only deleted for encryption failures (invalid device public key).

joshtrichards avatar Nov 01 '25 20:11 joshtrichards