[Bug]: Navigating away from Map causes unhandled promise rejection for "setHandledMapChangedEvents"
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 2.9k
- Forks
- 947
- Avg merge
- 6d 37m
- Merged PRs (30d)
- 1
Description
Mapbox Implementation
Mapbox
Mapbox Version
default
React Native Version
0.72.6
Platform
iOS
@rnmapbox/maps version
10.1.19
Standalone component to reproduce
import React from 'react';
import {
MapView,
ShapeSource,
LineLayer,
Camera,
} from '@rnmapbox/maps';
const aLine = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
};
class BugReportExample extends React.Component {
render() {
return (
<MapView style={{flex: 1}}>
<Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
<ShapeSource id="idStreetLayer" shape={aLine}>
<LineLayer id="idStreetLayer" />
</ShapeSource>
</MapView>
);
}
}
Observed behavior and steps to reproduce
I have a basic bottom tab navigation setup in my React Native app. Map is the first tab. Changing to any other tab from the map causes this error (I am getting 1000s of these events logged in Sentry):
WARN Possible Unhandled Promise Rejection (id: 2):
Object {
"code": "setHandledMapChangedEvents",
"domain": "RCTErrorDomain",
"message": "Unknown reactTag: 550",
"nativeStackIOS": Array [
"0 app 0x0000000103283670 RCTJSErrorFromCodeMessageAndNSError + 112",
"1 app 0x0000000103607798 ___ZZN8facebook5react15ObjCTurboModule13createPromiseERNS_3jsi7RuntimeENSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEU13block_pointerFvU13block_pointerFvP11objc_objectEU13block_pointerFvP8NSStringSH_P7NSErrorEEENK3$_0clES4_RKNS2_5ValueEPSQ_m_block_invoke.116 + 440",
"2 app 0x000000010415da59 __58-[RNMBXMapViewModule withMapView:block:reject:methodName:]_block_invoke + 425",
"3 app 0x000000010329c5ec __30-[RCTViewRegistry addUIBlock:]_block_invoke + 108",
"4 app 0x00000001032796a6 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke + 374",
"5 app 0x00000001032799b9 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.493 + 393",
"6 app 0x0000000103281fda __RCTExecuteOnMainQueue_block_invoke + 26",
"7 libdispatch.dylib 0x0000000129e29747 _dispatch_call_block_and_release + 12",
"8 libdispatch.dylib 0x0000000129e2a9f7 _dispatch_client_callout + 8",
"9 libdispatch.dylib 0x0000000129e3a856 _dispatch_main_queue_drain + 1362",
"10 libdispatch.dylib 0x0000000129e3a2f6 _dispatch_main_queue_callback_4CF + 31",
"11 CoreFoundation 0x0000000128617850 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9",
"12 CoreFoundation 0x000000012861218b __CFRunLoopRun + 2463",
"13 CoreFoundation 0x0000000128611409 CFRunLoopRunSpecific + 557",
"14 GraphicsServices 0x000000012caa8187 GSEventRunModal + 137",
"15 UIKitCore 0x00000001541b63a2 -[UIApplication _run] + 972",
"16 UIKitCore 0x00000001541bae10 UIApplicationMain + 123",
"17 app 0x00000001027153c0 main + 96",
"18 dyld 0x0000000112d693ee start_sim + 10",
"19 ??? 0x000000020ac373a6 0x0 + 8770515878",
],
"userInfo": null,
}
Expected behavior
No response
Notes / preliminary analysis
No response
Additional links and references
https://github.com/rnmapbox/maps/assets/45412175/10a50131-2fb2-4ce1-9539-44645b321d8c
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the RNMBXMapViewModule path for setHandledMapChangedEvents, using the standalone MapView, ShapeSource, LineLayer, and Camera example to reproduce the failure. Navigate away from the map on iOS and verify that the Unknown reactTag error no longer produces unhandled promise rejections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100