svthalia / Reaxit

The latest ThaliApp built on Flutter.
GNU General Public License v3.0
11 stars 3 forks source link

registration crashes if not completed before widget disposal #330

Closed JAicewizard closed 4 days ago

JAicewizard commented 1 year ago

Describe the bug

await _registrationsCubit.load(); should not be run in an async function as the cubit could have been closed see https://sentry.io/organizations/thalia/issues/3870488678/?project=1470826

Maybe the same tactic as for the calendar cubit should be used? Same goes for the _eventCubit.register() as it the function might (for some weird reason) not actually run before the widget is disposed.

How to reproduce

Steps to reproduce the behavior:

  1. register for an event
  2. probably press back before the registration is fully complete
  3. See error

Expected behaviour

not crash

DeD1rk commented 1 year ago

This shouldn't be a real crash right? This is just caught by sentry. We can more or less avoid triggering new events on closed blocs, but the sentry logs of new states do not actually indicate any issue.

JeeVee11 commented 1 year ago

This can be fixed by adding a check in every cubit any time emit() is called of the cubit is clossed or not, but this is a lot of work.

JAicewizard commented 1 year ago

@JeeVee11 Every event in the calendar screen can already have the cubit, that way the cubit will not be closed when closing events