Page MenuHomePhabricator

[native] Fix rescinds and badge-only notifs on iOS
ClosedPublic

Authored by ashoat on Sep 20 2023, 10:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 2:30 PM
Unknown Object (File)
Sat, Dec 14, 2:29 AM
Unknown Object (File)
Sat, Nov 30, 9:00 AM
Unknown Object (File)
Mon, Nov 25, 7:28 PM
Unknown Object (File)
Fri, Nov 22, 7:59 PM
Unknown Object (File)
Fri, Nov 22, 6:09 PM
Unknown Object (File)
Fri, Nov 22, 2:55 PM
Unknown Object (File)
Nov 13 2024, 2:10 AM
Subscribers

Details

Summary

D9178 broke this by requiring [content.userInfo[@"id"] to be non-nil in NotificationService.mm.

This diff makes it possible for that value to be nil without crashing the NSE.

Test Plan
  1. I managed to reproduce the issue in my local environment
  2. I then attached the Xcode debugger to the NSE, following the instructions here
  3. After my diff, I confirmed that the issue no longer occurs
  4. I also confirmed in the debugger that the value of [content.userInfo[@"id"] was in fact nil

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Sep 20 2023, 10:36 AM
atul accepted this revision.

Was there maybe some corresponding keyserver change that needed to be deployed before this release or something?

This revision is now accepted and ready to land.Sep 20 2023, 10:37 AM

Nope, this doesn't relate to any keyserver change

This revision was landed with ongoing or failed builds.Sep 20 2023, 10:40 AM
This revision was automatically updated to reflect the committed changes.
native/ios/NotificationService/NotificationService.mm
76–78 ↗(On Diff #31320)

Nit: I think generally we construct std::strings via eg std::ostringstream instead of + operator to avoid reallocating, but I think the performance overhead here is minimal so it doesn't matter and it was what was already there so it's probably not worth changing.