woltapp / wolt_modal_sheet

This package provides a responsive modal with multiple pages, motion animation for page transitions, and scrollable content within each page.
MIT License
511 stars 64 forks source link

_TypeError: Null check operator used on a null value in version 0.8.0 #279

Closed ibraheemalayan closed 3 months ago

ibraheemalayan commented 3 months ago

Bug report

a null check exception occurred on one of our user's devices ( android )

Steps to reproduce

Not sure how to reproduce since it occurred on a user's device and was reported by sentry. But here is the stack trace, it might help you find the issue

Dart 3.4.4 Flutter 3.22.3 Wolt Modal Sheet 0.8.0 ( it also happened in a version with the library of version 0.7.0 about three weeks ago )

Screenshot 2024-07-28 at 11 05 55

Raw stacktrace

_TypeError: Null check operator used on a null value
  File "framework.dart", line 1223, in State.setState
  File "wolt_modal_sheet_animated_switcher.dart", line 282, in _WoltModalSheetAnimatedSwitcherState._addPage.<fn>
  File "listener_helpers.dart", line 240, in AnimationLocalStatusListenersMixin.notifyStatusListeners
  File "animation_controller.dart", line 841, in AnimationController._checkStatusChanged
  File "animation_controller.dart", line 857, in AnimationController._tick
  File "ticker.dart", line 258, in Ticker._tick
  File "binding.dart", line 1392, in SchedulerBinding._invokeFrameCallback
  File "binding.dart", line 1235, in SchedulerBinding.handleBeginFrame.<fn>
  File "compact_hash.dart", line 633, in _LinkedHashMapMixin.forEach
  File "binding.dart", line 1233, in SchedulerBinding.handleBeginFrame
  File "binding.dart", line 1150, in SchedulerBinding._handleBeginFrame
  File "hooks.dart", line 328, in _invoke1
  File "platform_dispatcher.dart", line 397, in PlatformDispatcher._beginFrame
  File "hooks.dart", line 272, in _beginFrame
ulusoyca commented 3 months ago

@ibraheemalayan How often does this crash happen according to Sentry? Here is a potential fix since it is very difficult to reproduce but I have high level of confidence that I found out the root cause.

ibraheemalayan commented 3 months ago

@ulusoyca

We're still in early closed beta so the numbers could be larger when launching, but currently having only few users mostly developers and testers, it happened 3 times in the last month.

It's not common and looks like it doesn't cause a crash, just reported to sentry as an unhandled exception.

ulusoyca commented 3 months ago

@ibraheemalayan I see. Anyway, it is important to keep the Sentry clean. We can have 8.1.0 release after @TahaTesser reviews my PR.

ibraheemalayan commented 3 months ago

@ulusoyca Any updates ?

ulusoyca commented 3 months ago

This week we will release 0.9.0 and currently waiting for ReadMe changes. Probably tomorrow or during the weekend.

ulusoyca commented 3 months ago

@ulusoyca Any updates ?

@ibraheemalayan Looks like we still need to improve the Readme before the next release. However, the fix is merged to the main branch. Do you think that you can use hash in pubspec?

  wolt_modal_sheet:
    git:
      url: git@github.com:woltapp/wolt_modal_sheet.git
      ref: b3213c33c82c117143ea2fc4a23e41ff87cf8318
ulusoyca commented 3 months ago

Please don't hesitate to re-open the issue if you see this error in your Sentry logs.