UIP-3018 ResizeSensor intermittent null error in _reset
Open
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 432
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
- Issue Type: BUG
We're seeing stacktraces sometimes originating from ResizeSensor:
resize_sensor.dart ResizeSensorComponent._reset
resize_sensor.dart ResizeSensorComponent.componentDidMount.<anonymous function>
resize_sensor.dart _SafeAnimationFrameMixin.requestAnimationFrame.<anonymous function>
message: Uncaught exception: NullError: x is null
One potential cause of this is that _reset is being called after the component is unmounted, with the unmount taking place during the animation frame delay.
We should add a _isMounted check inside _reset to hopefully fix this.
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 in resize_sensor.dart at ResizeSensorComponent._reset and the componentDidMount animation-frame callback. Check the unmount path and verify that _reset does not access null state after unmount; done means the reported NullError no longer occurs in that scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100