maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: insertReactSubview crash if rapidly changed markers

Open Willham12 opened this issue 6 months ago • 3 comments

Mapbox Implementation

Mapbox

Mapbox Version

11.12.0

React Native Version

0.80.0

Platform

iOS

@rnmapbox/maps version

10.1.39

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

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM insertObject:atIndex:]: index 7 beyond bounds [0 .. 5]' *** First throw call stack:

  @objc open override func insertReactSubview(_ subview: UIView!, at atIndex: Int) {
    addToMap(subview)
    super.insertReactSubview(subview, at: atIndex)
  }

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

Willham12 avatar Jun 25 '25 03:06 Willham12

I think our issues are related. #3886

lvothnrv avatar Jun 25 '25 10:06 lvothnrv

@Willham12 is this still relevant? Can you reproduce it?! You should be able to programatically change a lot of markers, to emulate this scenario.

mfazekas avatar Oct 15 '25 19:10 mfazekas

Idk, switched to another library. Sorry and thanks for you effort.

Willham12 avatar Oct 16 '25 12:10 Willham12