Skip to content

[$250] [Sentry: APP-8MB] HybridApp Android Urban Airship PreferenceCenterActivity crash #95192

Closed

Description

@mountiny

Sentry

https://expensify.sentry.io/issues/APP-8MB

Impact (snapshot at filing)

  • Users (total since first seen): 71
  • Events: 76
  • Users (last 7d): 32
  • Events (last 7d): 32
  • First seen: 2026-03-28
  • Last seen: 2026-07-02 (ongoing)
  • Platform: Android HybridApp
  • App version(s): 9.4.23
  • Affected route(s): Urban Airship preference center deep link
  • Mechanism: chained (RuntimeException → IllegalArgumentException)

Stack trace (top frames, first-party only)

PreferenceCenterActivity.onCreate (Urban Airship SDK)
IllegalArgumentException: Missing required extra: EXTRA_ID

Suspected cause

HybridApp launches Urban Airship PreferenceCenterActivity without the required EXTRA_ID intent extra, causing a fatal crash on Android.

Reproduction

Unknown — see Sentry events linked from the Sentry issue.

Related

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @sharabai

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 2, 2026
  2. self-assigned this
    on Jul 2, 2026
  3. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 2, 2026
  4. melvin-bot commented on Jul 2, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @QichenZhu (External)

  5. KJ21-ENG commented on Jul 2, 2026

    @KJ21-ENG
    Contributor

    Proposal

    What is the root cause of that problem?

    Android includes Airship through @ua/react-native-airship, and the app registers an Airship extender during SDK initialization.

    App/package.json

    Lines 129 to 133 in a9e6aed

    "@sentry/core": "10.39.0",
    "@sentry/react-native": "8.2.0",
    "@shopify/flash-list": "2.3.0",
    "@shopify/react-native-skia": "^2.4.14",
    "@ua/react-native-airship": "26.5.0",

    <meta-data
    android:name="com.urbanairship.plugin.extender"
    android:value="com.expensify.chat.customairshipextender.CustomAirshipExtender" />

    That extender only replaces the push notification provider. It does not intercept Airship Preference Center display requests before Airship falls back to its default PreferenceCenterActivity, so a HybridApp preference-center action/deep link that arrives without a valid preference-center id can reach the SDK activity and crash with IllegalArgumentException: Missing required extra: EXTRA_ID.

    public void onAirshipReady(@NonNull Context context) {
    PushManager pushManager = Airship.getPush();
    CustomNotificationProvider notificationProvider = new CustomNotificationProvider(context, Airship.getAirshipConfigOptions());
    pushManager.setNotificationProvider(notificationProvider);

    HybridApp also overrides the normal React Native initial URL path, while Android still advertises new-expensify:// as the custom URI handler used for Urban Airship deep links. That leaves Airship Preference Center display handling outside the normal NewDot route validation path.

    if (CONFIG.IS_HYBRID_APP) {
    // On HybridApp we need to shadow official implementation of Linking.getInitialURL on NewDot side with our custom implementation.
    // Main benefit from this approach is that our deeplink-related code can be implemented the same way for both standalone NewDot and HybridApp.
    // It's not possible to use the official implementation from the Linking module because the way OldDot handles deeplinks is significantly different from a standard React Native app.
    Linking.getInitialURL = () => HybridAppModule.getInitialURL();

    <!-- Custom URI handlers. Used to intercept Urban Airship deep links. -->
    <intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="new-expensify" />
    </intent-filter>

    What changes do you think we should make in order to solve the problem?

    In CustomAirshipExtender.onAirshipReady, register a Preference Center open listener before returning. The listener should validate the incoming preferenceCenterId and return true for missing, blank, or unsupported ids so Airship does not launch the default Preference Center UI from malformed display requests.

    For a known supported preference-center id, either route through the app-owned deep link/custom UI path or return false to allow Airship's default handling only after the id is known to be valid. The existing Android intent handling is too late for this crash because it only runs after MainActivity receives an intent, while this crash happens inside Airship's activity creation path.

    if (intent != null) {
    handleIntent(intent)
    }
    }
    override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)
    if (intent.hasCategory(Intent.CATEGORY_LAUNCHER)
    && intent.getAction() != null
    && intent.getAction().equals(Intent.ACTION_MAIN)) {
    wasAppRelaunchedFromIcon = true
    }
    setIntent(intent) // Must store the new intent unless getIntent() will return the old one
    handleIntent(intent)
    }
    private fun handleIntent(intent: Intent) {
    try {
    val intenthandler = IntentHandlerFactory.getIntentHandler(this, intent.type, intent.toString())
    intenthandler?.handle(intent)

    Test coverage:

    • Add an Android unit/Robolectric test around the Airship extender preference-center open listener verifying malformed or unsupported ids are consumed and do not start the SDK activity.
    • Add a positive test for a supported preference-center id so the intended app routing or default Airship handling still works.
    • Manually verify the Android HybridApp Urban Airship preference-center action/deep link no longer crashes, and that normal report push notification deep links still route through new-expensify://.

    What alternative solutions did you explore? (Optional)

    We could try to catch this in MainActivity, but that is too late because the failing stack is in Airship's PreferenceCenterActivity.onCreate. We could also remove the Preference Center module entirely, but guarding display requests at the Airship extension point is narrower and preserves any valid Preference Center behavior.

  6. changed the title [-][Sentry: APP-8MB] HybridApp Android Urban Airship PreferenceCenterActivity crash[/-] [+][$250] [Sentry: APP-8MB] HybridApp Android Urban Airship PreferenceCenterActivity crash[/+] on Jul 2, 2026
  7. melvin-bot commented on Jul 2, 2026

    @melvin-bot
  8. aswin-s commented on Jul 2, 2026

    @aswin-s
    Contributor

    Note: This proposal is not a duplicate. It identifies a deeper root cause rather than the surface symptom.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On Android HybridApp, opening a push notification (or handling an Airship deep-link) that triggers Urban Airship's PreferenceCenterActivity crashes the app with IllegalArgumentException: Missing required extra: EXTRA_ID because the activity is launched without the required com.urbanairship.preference_center_id intent extra. Expected behavior: the notification/deep-link should either open a valid preference center screen or be handled gracefully (routed to the app's own settings) without crashing.

    What is the root cause of that problem?

    The app registers CustomAirshipExtender (android/app/src/main/java/com/expensify/chat/customairshipextender/CustomAirshipExtender.java:9-16) via the com.urbanairship.plugin.extender meta-data in android/app/src/main/AndroidManifest.xml:176-178, but onAirshipReady only configures a CustomNotificationProvider — it never installs a PreferenceCenter.OnOpenListener and never overrides the default open_preference_center_action. When an Airship-side campaign/deep-link fires a preference_center action, the Airship SDK falls back to launching its stock PreferenceCenterActivity via an Intent with no EXTRA_ID (because the payload doesn't include one, or the extras are stripped by the app's MainActivity singleTask deep-link interception at AndroidManifest.xml:41-63), which causes the crash in the SDK's onCreate. The consumer of the missing extra is Airship's own PreferenceCenterActivity.onCreate; the producer is the un-guarded Airship action dispatch — the app never provides an OnOpenListener to intercept it.

    What changes do you think we should make in order to solve the problem?

    1. In android/app/src/main/java/com/expensify/chat/customairshipextender/CustomAirshipExtender.java:11 onAirshipReady, register PreferenceCenter.shared().setOpenListener(...) returning true so the SDK skips its default activity launch, and either route to the app's in-app settings screen or no-op when the id is null/empty.
    2. Alternatively, override the open_preference_center_action in the Airship action registry inside the same onAirshipReady to a custom action that validates presence of the preference-center id before dispatch and drops the action silently when missing.
    3. Add a defensive check on the launched intent: if unavoidable, register an Application.ActivityLifecycleCallbacks in MainApplication.onCreate that intercepts PreferenceCenterActivity instantiation and finishes it when EXTRA_ID (com.urbanairship.preference_center_id) is absent, preventing the SDK crash.
    4. Log the offending payload via Airship's AutopilotListener/deep-link listener so we can identify which campaign is emitting malformed preference-center actions and correct it server-side.

    What alternative solutions did you explore? (Optional)

  9. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor

    ⚠️ @aswin-s Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  10. trasnake87 commented on Jul 2, 2026

    @trasnake87
    Contributor

    Proposal

    What is the root cause of that problem?

    This is a HybridApp-exclusive crash with two compounding gaps: one in the native layer and one in the JavaScript layer, and neither is individually sufficient to explain the intermittency.

    Why only HybridApp: In standalone builds (STANDALONE_NEW_DOT=true) there are no OldDot push campaigns and therefore no preference-center open requests. In HybridApp, OldDot and NewDot share a single UAirship instance (initialized by the React Native Airship plugin's Autopilot before the RN bridge is ready). OldDot sends preference-center push campaigns; NewDot's Airship instance receives and dispatches them. That dispatch path never touches the JS bridge in the crashing case.

    The native dispatch chain: When Airship's open_preference_center_action fires on Android with a null or blank preference-center ID, the SDK calls PreferenceCenter.shared().open(id) → builds an Intent → putExtra(EXTRA_ID, id). Because putExtra with a null value is a no-op, the extra is absent. PreferenceCenterActivity.onCreate calls requireNotNull(intent.getStringExtra(EXTRA_ID)) → IllegalArgumentException: Missing required extra: EXTRA_ID → Android wraps it as the fatal RuntimeException seen in the Sentry trace. This all happens at native Activity startup — the React Native bridge is not consulted and never fires a JS event.

    Why the JS layer never intercepts it: CustomAirshipExtender.onAirshipReady (android/app/src/main/java/com/expensify/chat/customairshipextender/CustomAirshipExtender.java) runs at SDK-ready time and registers only a CustomNotificationProvider. No PreferenceCenter.OnOpenListener is installed, so the SDK's default behavior (auto-launch) is never overridden. Separately, src/libs/Notification/PushNotification/index.native.ts:83-87 registers PushReceived and NotificationResponse handlers but nothing for DisplayPreferenceCenter, meaning even valid preference-center opens have no JS handler to route them gracefully.

    Why intermittent: The crash fires only for the subset of OldDot preference-center campaigns where the preference-center ID field is null or empty — 76 events across 71 users is consistent with an infrequent campaign misconfiguration rather than a systematic code path exercised on every launch.

    What changes do you think we should make in order to solve the problem?

    Layer 1 — native null guard (required, fixes the crash): In CustomAirshipExtender.onAirshipReady, register a PreferenceCenter.OnOpenListener that intercepts opens before the SDK can start PreferenceCenterActivity:

    import com.urbanairship.preferencecenter.PreferenceCenter;
    
    @Override
    public void onAirshipReady(@NonNull Context context) {
        PushManager pushManager = Airship.getPush();
        CustomNotificationProvider notificationProvider =
                new CustomNotificationProvider(context, Airship.getAirshipConfigOptions());
        pushManager.setNotificationProvider(notificationProvider);
    
        PreferenceCenter.shared().setOpenListener(preferenceCenterId -> {
            // Swallow null/blank IDs to prevent "Missing required extra: EXTRA_ID" crash.
            // Return false for a real ID so the SDK launches the activity normally.
            return preferenceCenterId == null || preferenceCenterId.trim().isEmpty();
        });
    }

    Returning true = handled (SDK never starts the activity). Returning false for a non-empty ID preserves normal SDK behavior for any legitimate preference-center open.

    Layer 2 — JS handler (optional, improves UX for valid IDs): In src/libs/Notification/PushNotification/index.native.ts, register a DisplayPreferenceCenter listener alongside the existing PushReceived/NotificationResponse handlers. For HybridApp this can simply no-op or route to the NewDot notification-settings screen, ensuring that if the native listener passes a valid ID through (return false), NewDot controls where the user lands rather than defaulting to the SDK's bundled UI.

    What alternative solutions did you explore? (Optional)

    PreferenceCenter.setAutoLaunchPreferenceCenter(id, false) requires a known, non-null ID as its key and so cannot suppress auto-launch for the null/blank case that actually triggers this crash — ruling it out as the primary fix.


    Restoring this proposal — it was auto-flagged as a duplicate of an earlier proposal, but the analysis differs materially: ours explains HybridApp-exclusivity, null-putExtra dispatch chain, intermittency cause, and adds JS-layer fix.

  11. 47 remaining items

  12. zmx2013 commented on Aug 10, 2026

    @zmx2013

    @QichenZhu I reviewed the available official documentation and need to correct the scope of my previous response.

    I could not find official Google or Firebase guidance supporting the specific claim that Play pre-launch reports or Robo Test use privileged access to explicitly launch a non-exported activity without its required extras.

    The official documentation establishes that:

    Neither document establishes a connection between Robo Test and the root-only explicit component launch used to reproduce this issue.

    Airship 20.7.0 also establishes that:

    Therefore, attributing the Sentry events to Firebase Test Lab or another automated scanner remains an inference, not a confirmed root cause. My previous statement that DeepLinkListener or OnOpenListener would address the confirmed explicit component launch was also incorrect; those mechanisms do not intercept a direct am start -n ...PreferenceCenterActivity invocation.

    The confirmed evidence is currently limited to the following:

    1. The crash can be reproduced through a privileged explicit component launch.
    2. The affected component is not exported to ordinary third-party applications.
    3. Airship's supported opening paths supply and validate the Preference Center ID.
    4. The available Sentry information indicates little or no normal application activity, but does not identify the process that initiated the component launch.

    Determining the actual source would require additional Sentry evidence, such as device and environment tags, breadcrumbs, launch-intent information, or metadata identifying Google Play pre-launch or Firebase Test Lab devices.

    Based on the current evidence, this does not demonstrate a security vulnerability. If the events are confirmed to originate exclusively from privileged scanners, ignoring or closing the issue may be appropriate. If defensive handling of malformed privileged launches is still desired to eliminate Sentry noise, the guarded activity and same-name activity-alias approach addresses that entry path directly.

    For completeness, two implementation details in my previous sample also require correction:

    • super.onCreate(savedInstanceState) must execute before any early finish() return.
    • The intent filter must use Airship 20.7.0's exact action string: com.urbanairship.VIEW_PREFERENCE_CENTERX, including the trailing X.
  13. QichenZhu commented on Aug 11, 2026

    @QichenZhu
    Contributor

    If the events are confirmed to originate exclusively from privileged scanners, ignoring or closing the issue may be appropriate.

    Makes sense to me.

  14. zmx2013 commented on Aug 12, 2026

    @zmx2013

    @QichenZhu The conclusion depends on confirming that the Sentry events originate exclusively from privileged scanners. At present, the publicly available evidence does not establish that condition.

    The latest public Sentry update reports 237 affected users in total and continuing events on Android HybridApp releases: #95192 (comment)

    These figures do not, by themselves, prove normal user impact. However, they also do not provide sufficient evidence to classify every event as privileged scanner traffic.

    Before determining whether the issue is non-actionable, could you review a representative sample of the Sentry events for:

    • device model and manufacturer;
    • environment and application release;
    • session breadcrumbs or normal navigation preceding the crash;
    • root or emulator indicators, if available;
    • fingerprints associated with Google Play pre-launch reports or Firebase Test Lab;
    • evidence distinguishing a direct explicit component launch from an Airship-supported opening path.

    If any event originates from an ordinary production environment or a supported Airship flow, the privileged-scanner explanation would not fully account for the issue, and a defensive native guard would remain relevant.

    Once that metadata is available, I can update the root-cause analysis and implementation scope to align with the evidence.

  15. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 13, 2026
  16. sharabai commented on Aug 13, 2026

    @sharabai
    Contributor

    @mountiny @QichenZhu

    Dug into the 256 events on APP-8MB. The device data isn't just suspicious, it's fabricated.

    This doesn't look like a security scanner or real users. It looks like an automated emulator farm running the Play Store build and blindly launching exported activities.

    PreferenceCenterActivity is exported by the Airship SDK, so anything on the device can launch it without EXTRA_ID, which then hard-crashes. The crash itself is genuine, but nothing in our UI leads there.

    My read is that this doesn't warrant a fix: hardening the activity would mean overriding Airship's manifest entry, which is real effort with no meaningful benefit for real users.

    A few interesting things in the events:

    • All 255 non-emulator events report the same model_id: QKR1.191246.002 across three supposedly different phones (OnePlus 8 Pro, HONOR 20e, OnePlus One). Different OEMs can't share a build fingerprint, and 191246 isn't even a valid date — Android build IDs are YYMMDD, so that's day 46.
    • All 255 report a byte-for-byte identical kernel_version, down to the -dirty suffix and Google buildbot path. A 2020 OnePlus flagship, a HONOR 20e, and a 2014 OnePlus One obviously don't ship with the same kernel.

    The one remaining event is a genuine device but not a real user path: a Google emulator in Auckland, five days after this issue was filed, launching PreferenceCenterActivity externally while logged out on the sign-in screen.

  17. QichenZhu commented on Aug 13, 2026

    @QichenZhu
    Contributor

    @sharabai, thanks for the thorough investigation.

    My read is that this doesn't warrant a fix: hardening the activity would mean overriding Airship's manifest entry, which is real effort with no meaningful benefit for real users.

    Fully agree with your assessment.

    The one remaining event is a genuine device but not a real user path: a Google emulator in Auckland, five days after this issue was filed, launching PreferenceCenterActivity externally while logged out on the sign-in screen.

    That was me 😄 : #95192 (comment)

    cc @mountiny

  18. zmx2013 commented on Aug 14, 2026

    @zmx2013
    @mountiny @sharabai @QichenZhu
    
    Thanks for the investigation. I agree that the observed APP-8MB traffic appears synthetic, so I’m not arguing that these events represent normal user impact.
    
    I do think there is still a significantly smaller and cleaner actionable path than maintaining an Expensify-side manifest override, activity alias, or other application-specific workaround.
    
    Airship’s current `PreferenceCenterActivity` still converts a malformed launch into a fatal host-process crash:
    
    ```kotlin
    val id = PreferenceCenter.parsePreferenceCenterId(intent)
        ?: throw IllegalArgumentException("Missing required extra: EXTRA_ID")

    Normal Airship opens already provide the required ID through PreferenceCenter.open(preferenceCenterId), so an upstream change that logs the malformed invocation, finishes the Activity, and returns would leave the supported Preference Center flow unchanged while making unexpected or malformed launches non-fatal.

    In other words, I’m not proposing that Expensify add special handling for synthetic devices. I’m proposing that the component which currently throws should fail gracefully when its required launch argument is absent.

    That suggests an upstream-first resolution:

    1. Submit the minimal missing-ID guard to urbanairship/android-library.
    2. Work through the upstream review and get the fix released by Airship.
    3. Update Expensify to the Airship / @ua/react-native-airship version containing the fix.
    4. Verify that valid Preference Center opens remain unchanged and that new APP-8MB fatal events from this malformed-launch case stop occurring.

    This approach avoids maintaining an Expensify-specific Activity replacement, avoids hard-coding emulator or device fingerprints, avoids adding a Sentry-only suppression for one signature, and fixes the failure at the component that actually throws.

    There is also a close precedent in #95193, another Android HybridApp Sentry issue from the same tracker. In that case, the underlying FullscreenPlayerActivity crash was fixed upstream in expo-video, and the Expensify-side resolution was to consume the upstream fix through a dependency update. That issue was completed under its $250 bounty.

    Given that precedent, @mountiny, would you be open to keeping #95192 and the current $250 bounty active, with this upstream-first path considered an acceptable completion scope?

    The Expensify-side deliverable would be to consume the released Airship fix, validate the affected Android HybridApp flow, and verify that the malformed-launch crash no longer produces APP-8MB fatal events.

    If so, I’m happy to take ownership of preparing and submitting the Airship upstream fix, follow it through upstream review, and then handle the Expensify dependency update once the fix is released.

  19. mountiny commented on Aug 14, 2026

    @mountiny
    ContributorAuthor

    Thank you all! I think given this is not a real user flow, I resolved the issue in Sentry and closing this task.

  20. mountiny commented on Aug 17, 2026

    @mountiny
    ContributorAuthor

    Post-fix check on APP-8MB. Not reopening — recording why.

    Sentry moved the issue to regressed and it has fired since this closed on 2026-08-14, but every one of those events is on a build that predates the fix:

    • Last seen: 2026-08-16, on release new.expensify@9.4.53-3 (built 2026-08-13)
    • Users (last 14d, scoped to 9.4.52 / 9.4.53 / 9.4.54): 8
    • Users (total since first seen): 261

    So this is expected residual from users still on pre-fix builds, not a regression. Worth re-checking once 9.4.55+ has meaningful adoption; if events appear on a post-fix release, reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions