Skip to content

react-native-performance - fix soft crash patch #66231

Closed

Description

@war-in

If you haven't already, check out our contributing guidelines and patch guidelines for information on how to manage patches.


Patch Information

Library Name: ract-native-performance
Library Version: 5.1.4
Patch Number: 001
Patch Description: fix-soft-crash-by-checking-for-active-react-instance
Full Patch Filename: react-native-performance+5.1.4+001+fix-soft-crash-by-checking-for-active-react-instance.patch

Patch Details

Reason for Patch

react-native-performance emits some events using RCTDeviceEventEmitter on Android. Emitter should be used only after react instance has been created.
Otherwise, soft exception is thrown:

```
raiseSoftException(callWithExistingReactInstance(callFunctionOnModule("RCTDeviceEventEmitter", "emit"))): Execute: reactInstance is null. Dropping work.
```

Changes Made

I wrapped code emitting events ⬇️

getReactApplicationContext()
    .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
    .emit("mark", params);

with a check for react instance

if (getReactApplicationContext().hasActiveReactInstance()) {
    ...
}

Upstream Status

Upstream PR/Issue: oblador/react-native-performance#117

Related Information

PR Introducing Patch: #66230

Additional Notes

Checklist

  • Patch file is correctly named and placed in the appropriate directory
  • Patch is documented in the corresponding details.md file
  • This issue is linked in the details.md file
  • Upstream PR/issue has been created (if applicable)

Activity

  1. melvin-bot commented on Oct 13, 2025

    @melvin-bot

    @war-in, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

  2. mateuuszzzzz commented on Nov 13, 2025

    @mateuuszzzzz
    Contributor

    Patch can be removed. Those changes were released in version 6.0.0

  3. added
    Reviewing
    Weekly
    and removed on Nov 17, 2025
  4. added
    Weekly
    and removed
    Weekly
    on Nov 27, 2025
  5. melvin-bot commented on Dec 1, 2025

    @melvin-bot

    Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

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

Metadata

Metadata

Assignees

Labels

Not a priorityReviewingWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions