Skip to content

[Bug]: NSInvalidArgumentException OSModelStore.swift:93 #1826

@mannoeu

Description

@mannoeu

What happened?

App crashs:

  • iPhone 11 (iPhone12,1)
  • iOS 17.1.2

Steps to reproduce?

There are no clues, the user just opened the app and encountered the error

What did you expect to happen?

The critical line of the error is here:
OSModelStore.add(id:model:hydrating:)

The OneSignal SDK is probably trying to do something like:
dict["someKey"] = someDateValue

And expecting a dictionary or array like someDateValue, but actually receiving an NSDate.

When trying to call .count on this object, the app crashes because NSDate doesn't have that method.

React Native OneSignal SDK version

5.2.11

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

CrashReporter Key:  b5011a077722804e7a124d5b5fcc35439aca26db
Hardware Model:     iPhone12,1
Process:            closeer
Identifier:         com.closeer.closeer-user
Version:            3.15.0
Role:               Foreground
OS Version:         iOS 17.1.2


NSInvalidArgumentException: -[__NSTaggedDate count]: unrecognized selector sent to instance 0x8000000000000000

0  CoreFoundation +0xec86c        ___exceptionPreprocess
1  libobjc.A.dylib +0x2bbfc       _objc_exception_throw
2  CoreFoundation +0x17d198       -[NSObject(NSObject) doesNotRecognizeSelector:]
3  CoreFoundation +0x31ff4        ____forwarding___
4  CoreFoundation +0x172b0c       ___forwarding_prep_0___
5  libswiftCore.dylib +0xabac8    Dictionary._Variant.setValue(_:forKey:)
6  libswiftCore.dylib +0x58a94    Dictionary.subscript.setter
7  OneSignalOSCore +0xbd64        OSModelStore.add(id:model:hydrating:) (OSModelStore.swift:93:20)
8  OneSignalUser +0x77d4          OneSignalUserManagerImpl.setNewInternalUser(externalId:pushSubscriptionModel:) (OneSignalUserManagerImpl.swift:470:35)
9  OneSignalUser +0x6860          OneSignalUserManagerImpl.createNewUser(externalId:token:) (OneSignalUserManagerImpl.swift:331:23)
10 OneSignalUser +0x70d8          OneSignalUserManagerImpl._login(externalId:token:) (OneSignalUserManagerImpl.swift:409:16)
11 OneSignalUser +0x4af0          OneSignalUserManagerImpl.user.getter (OneSignalUserManagerImpl.swift:139:20)
12 OneSignalUser +0xa4d4          OneSignalUserManagerImpl.setPushToken(_:) (OneSignalUserManagerImpl.swift:886:9)
13 OneSignalUser +0xa5b8          @objc OneSignalUserManagerImpl.removeAlias(_:)
14 OneSignalNotifications +0x61fc +[OSNotificationsManager sendPushTokenToDelegate] (OSNotificationsManager.m:487:9)
15 OneSignalNotifications +0x602c +[OSNotificationsManager didRegisterForRemoteNotifications:deviceToken:] (OSNotificationsManager.m:464:5)
16 OneSignalNotifications +0x8aa0 -[OneSignalNotificationsAppDelegate oneSignalDidRegisterForRemoteNotifications:deviceToken:] (UIApplicationDelegate+OneSignalNotifications.m:116:5)
17 UIKitCore +0xe20fd8            ___63-[UIApplication pushRegistry:didUpdatePushCredentials:forType:]_block_invoke
18 libdispatch.dylib +0x26a4      __dispatch_call_block_and_release
19 libdispatch.dylib +0x42fc      __dispatch_client_callout
20 libdispatch.dylib +0x12994     __dispatch_main_queue_drain
21 libdispatch.dylib +0x125ac     __dispatch_main_queue_callback_4CF
22 CoreFoundation +0x37208        ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
23 CoreFoundation +0x33f14        ___CFRunLoopRun
24 CoreFoundation +0x33664        _CFRunLoopRunSpecific
25 GraphicsServices +0x35e8       _GSEventRunModal
26 UIKitCore +0x22c2b0            -[UIApplication _run]
27 UIKitCore +0x22b8ec            _UIApplicationMain
28 closeer +0x82fc                main (main.m:8:12)
29 dyld +0x5dc8                   start

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions