Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix display of incoming call for group calls when receiving VOIP noti… #7875

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

hek4ek
Copy link
Contributor

@hek4ek hek4ek commented Dec 2, 2024

…fication

Problem: When making a group call and the "Ring for group calls" option is enabled, the incoming call is not displayed (CallKit functionality)

Reason: The name for the incoming call is generated via the localizedUserNotificationStringForKey method of the NSString extension, but the result of the method is an instance of the UNLocalizedString class, which is not allowed for the CallKit subsystem. This is reported by the operating system log:

Attempted to decode a collection type 'UNLocalizedString' (subclass of 'NSString') for key 'localizedCallerName'. 'UNLocalizedString' requires its subclasses to be explicitly added to the allowed classes list but it is not present. Allowing this has been a source of security issues. Please ensure you meant this type to be in archives: 'UNLocalizedString' (0x1fc31f888) [/System/Library/Frameworks/UserNotifications.framework]
NSXPCInterface: <NSXPCInterface: 0xbdad37900>
Protocol: CXProviderVendorProtocol
SEL: commitTransaction: (1 arguments, 0 proxies)
 Classes: [{NSNumber, NSURL, NSError, CXCallUpdate, NSDate, NSDictionary, NSString, NSSet, CXTransaction, CXAction, NSArray, NSOrderedSet, NSUUID, NSData, NSMutableSet, NSMutableOrderedSet, NSMutableArray, NSMutableDictionary}]
 Reply block: (arg #-1, (0 arguments, 0 proxies), signature '(null)') []

<NSXPCConnection: 0xbdad3c820> connection from pid 592 on mach service named com.apple.callkit.callsourcehost

and also the following error:

<NSXPCConnection: 0xbdad3c820> connection from pid 592 on mach service named com.apple.callkit.callsourcehost: Exception caught during decoding of received selector reportNewIncomingCallWithUUID:update:reply:, dropping incoming message.
Exception: Exception while decoding argument 1 (#3 of invocation):
Exception: value for key 'localizedCallerName' was of unexpected class 'UNLocalizedString' (0x1fc31f888) [/System/Library/Frameworks/UserNotifications.framework].
Allowed classes are:
 {(
 "'NSString' (0x1fc2886c8) [/System/Library/Frameworks/Foundation.framework]"
)}
(
 0 CoreFoundation 0x000000019b57cf2c 00E76A98-210C-3CB5-930B-F236807FF24C + 540460
 1 libobjc.A.dylib 0x0000000193432018 objc_exception_throw + 60
 2 Foundation 0x000000019a3aeba0 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 39840
 3 Foundation 0x000000019a3ae6a8 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 38568
 4 Foundation 0x000000019a3ae068 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 36968
 5 Foundation 0x000000019a3ad164 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 33124
 6 CallKit 0x00000001bcf6e300 F71F082D-30F3-3293-BCC2-B86903390905 + 230144
 7 Foundation 0x000000019a3ae6e8 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 38632
 8 Foundation 0x000000019a3ad030 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 32816
 9 Foundation 0x000000019a40b750 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 419664
 10 Foundation 0x000000019a408800 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 407552
 11 Foundation 0x000000019a460fe4 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 770020
 12 Foundation 0x000000019a45fd50 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 765264
 13 Foundation 0x000000019a45f4b4 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 763060
 14 Foundation 0x000000019a45f36c 3D3A12E3-F5E9-361F-B00A-4A5E8861AA55 + 762732
 15 libxpc.dylib 0x00000001f8424cbc 3614A74F-EDA2-3843-8092-CEDB505020F0 + 72892
 16 libxpc.dylib 0x00000001f8426908 3614A74F-EDA2-3843-8092-CEDB505020F0 + 80136
 17 libdispatch.dylib 0x00000001a3421e94 81D355DF-266A-3010-BAB8-113B76A206C1 + 16020
 18 libdispatch.dylib 0x00000001a343e000 81D355DF-266A-3010-BAB8-113B76A206C1 + 131072
 19 libdispatch.dylib 0x00000001a3429284 81D355DF-266A-3010-BAB8-113B76A206C1 + 45700
 20 libdispatch.dylib 0x00000001a343ed50 81D355DF-266A-3010-BAB8-113B76A206C1 + 134480
 21 libdispatch.dylib 0x00000001a3429284 81D355DF-266A-3010-BAB8-113B76A206C1 + 45700
 22 libdispatch.dylib 0x00000001a3429f64 81D355DF-266A-3010-BAB8-113B76A206C1 + 48996
 23 libdispatch.dylib 0x00000001a3434cb4 81D355DF-266A-3010-BAB8-113B76A206C1 + 93364
24 libdispatch.dylib 0x00000001a3434528 81D355DF-266A-3010-BAB8-113B76A206C1 + 91432

and 6 seconds after these errors the system stops the application with the following reason:

Killing VoIP app <private> because it failed to post an incoming call in time.

Solution: explicitly cast the result of localizedUserNotificationStringForKey to NSString

Pull Request Checklist

  • I read the contributing guide
  • UI change has been tested on both light and dark themes, in portrait and landscape orientations and on iPhone and iPad simulators
  • Accessibility has been taken into account.
  • Pull request is based on the develop branch
  • Pull request contains a changelog file in ./changelog.d
  • You've made a self review of your PR
  • Pull request includes screenshots or videos of UI changes
  • Pull request includes a sign off

Signed-off-by: [email protected]

Fixes #7858

@CLAassistant
Copy link

CLAassistant commented Dec 2, 2024

CLA assistant check
All committers have signed the CLA.

@hek4ek hek4ek force-pushed the fix-ringing-for-group-calls branch from 283c430 to d5fc324 Compare December 3, 2024 07:07
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into the cause of this @hek4ek. Once small suggestion below 👇

Otherwise looks reasonable to me.

@hek4ek
Copy link
Contributor Author

hek4ek commented Dec 4, 2024

Thanks for looking into the cause of this @hek4ek. Once small suggestion below 👇

Otherwise looks reasonable to me.

Happy to address the suggestion, it’s just that I can’t see it… Is there something missed?

@pixlwave
Copy link
Member

pixlwave commented Dec 4, 2024

Happy to address the suggestion, it’s just that I can’t see it… Is there something missed?

Huh, not sure where it went, should be there now.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 16.21%. Comparing base (eaedc34) to head (4e62d1f).
Report is 16 commits behind head on develop.

Files with missing lines Patch % Lines
Riot/Managers/Call/CallPresenter.swift 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #7875       +/-   ##
============================================
- Coverage    62.06%   16.21%   -45.86%     
============================================
  Files          504     1810     +1306     
  Lines        21096   173591   +152495     
  Branches      7964    67307    +59343     
============================================
+ Hits         13094    28150    +15056     
- Misses        7973   145393   +137420     
- Partials        29       48       +19     
Flag Coverage Δ
unittests 9.06% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks @hek4ek, this looks good to me 👍

@pixlwave pixlwave merged commit 328af0c into element-hq:develop Dec 4, 2024
6 of 8 checks passed
@alexander-potemkin
Copy link

@pixlwave , thank you as well!
Is there any estimate when it could make it to the AppStore release?

@pixlwave
Copy link
Member

pixlwave commented Dec 5, 2024

Should be TestFlight around the 10th and App Store around the 16th if everything is on schedule.

@alexander-potemkin
Copy link

Should be TestFlight around the 10th and App Store around the 16th if everything is on schedule.

Got it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No sound / call on group calls
4 participants