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)
Wed, Nov 13, 2:10 AM
Unknown Object (File)
Fri, Nov 8, 8:18 AM
Unknown Object (File)
Thu, Oct 31, 1:14 PM
Unknown Object (File)
Thu, Oct 31, 1:14 PM
Unknown Object (File)
Oct 1 2024, 4:29 PM
Unknown Object (File)
Oct 1 2024, 4:29 PM
Unknown Object (File)
Oct 1 2024, 4:27 PM
Unknown Object (File)
Oct 1 2024, 10:03 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.