Skip to content

fix(android): fix onMapSteady event crash - #4162

Merged
mfazekas merged 2 commits into
mainfrom
fix-on-map-steady
Feb 21, 2026
Merged

mfazekas merged 2 commits into
mainfrom
fix-on-map-steady

Conversation

@mfazekas

Copy link
Copy Markdown
Contributor

Fix CameraGestureObserver crash on Android: Unsupported top level event type "topOnMapSteady" dispatched. The event key didn't match the codegen-registered name. Changed to onMapSteady to match the JS prop directly.

Fixes #4105

Event key was "topOnMapSteady" which doesn't match the codegen-registered
name. Use "onMapSteady" to match the JS prop directly.

Fixes #4105
- Override toJSON() in MapSteadyEvent to return flat payload (not wrapped
  in type/payload structure) so JS receives fields on nativeEvent directly
- Fix timer leak in scheduleQuietCheck — cancel previous before scheduling
- Fix scheduleTimeout to not reset on every markActivity, enabling periodic
  heartbeat timeouts during long gestures
- Remove emittedForCurrentActivity flag (no longer needed with timer fixes)
@mfazekas
mfazekas merged commit 5a4e5ee into main Feb 21, 2026
7 checks passed
@mfazekas
mfazekas deleted the fix-on-map-steady branch February 21, 2026 16:30
mariusud pushed a commit to mariusud/maps that referenced this pull request Apr 22, 2026
* fix(android): fix onMapSteady event name causing crash

Event key was "topOnMapSteady" which doesn't match the codegen-registered
name. Use "onMapSteady" to match the JS prop directly.

Fixes rnmapbox#4105

* fix(android): fix event payload and timer bugs in CameraGestureObserver

- Override toJSON() in MapSteadyEvent to return flat payload (not wrapped
  in type/payload structure) so JS receives fields on nativeEvent directly
- Fix timer leak in scheduleQuietCheck — cancel previous before scheduling
- Fix scheduleTimeout to not reset on every markActivity, enabling periodic
  heartbeat timeouts during long gestures
- Remove emittedForCurrentActivity flag (no longer needed with timer fixes)

This branch was previously deployed

1 inactive deployment
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.

[Bug]: Crash/white screen on Android with CameraGestureObserver

1 participant