alexeyinkin opened a new issue, #21950:
URL: https://github.com/apache/beam/issues/21950

   ### What happened?
   
   On a development machine, the exception is thrown after startup. Sometimes 
more than one.
   
   ```
   errors.dart:251 Uncaught (in promise) Error: A PlaygroundState was used 
after being disposed.
   Once you have called dispose() on a PlaygroundState, it can no longer be 
used.
       at Object.throw_ [as throw] (errors.dart:251:49)
       at change_notifier.dart:125:9
       at [_debugAssertNotDisposed] (change_notifier.dart:130:14)
       at playground_state.PlaygroundState.new.notifyListeners 
(change_notifier.dart:304:12)
       at playground_state.PlaygroundState.new.setOutputResult 
(playground_state.dart:125:5)
       at playground_state.PlaygroundState.new.setExample 
(playground_state.dart:105:5)
       at playground_page_providers.dart:77:38
       at _RootZone.runUnary (zone.dart:1685:54)
       at _FutureListener.then.handleValue (future_impl.dart:147:18)
       at handleValueCallback (future_impl.dart:766:44)
       at _Future._propagateToListeners (future_impl.dart:795:13)
       at [_completeWithValue] (future_impl.dart:566:5)
       at future.dart:527:22
       at _RootZone.runUnary (zone.dart:1685:54)
       at _FutureListener.then.handleValue (future_impl.dart:147:18)
       at handleValueCallback (future_impl.dart:766:44)
       at _Future._propagateToListeners (future_impl.dart:795:13)
       at [_complete] (future_impl.dart:557:7)
       at stream.dart:1035:13
       at _RootZone.runGuarded (zone.dart:1606:10)
       at sendDone (stream_impl.dart:394:13)
       at _RootZone.run (zone.dart:1679:54)
       at _FutureListener.whenComplete.handleWhenComplete 
(future_impl.dart:190:18)
       at handleWhenCompleteCallback (future_impl.dart:736:38)
       at _Future._propagateToListeners (future_impl.dart:792:11)
       at [_completeWithValue] (future_impl.dart:566:5)
       at future.dart:527:22
       at _RootZone.runUnary (zone.dart:1685:54)
       at _FutureListener.then.handleValue (future_impl.dart:147:18)
       at handleValueCallback (future_impl.dart:766:44)
       at _Future._propagateToListeners (future_impl.dart:795:13)
       at async._AsyncCallbackEntry.new.callback (future_impl.dart:430:9)
       at Object._microtaskLoop (schedule_microtask.dart:40:11)
       at _startMicrotaskLoop (schedule_microtask.dart:49:5)
       at async_patch.dart:166:15
   ```
   
   This also happens in production, but exceptions are not visible there. User 
experience is not impacted.
   
   Cause:
   
   At this line:
   
https://github.com/apache/beam/blob/0ef5d3a185c1420da118208353ceb0b40b3a27c9/playground/frontend/lib/pages/playground/components/playground_page_providers.dart#L62
   `PlaygroundState` object is re-created when anything in `ExampleState` (the 
snippet directory) changes. I have seen it happening 6 times at startup. This 
leads to the old `PlaygroundState`s being disposed in a split second after 
being created.
   
   However, a few lines after that we call `setExample` on them after the 
asynchronous gap. So this call often happens when the object is already 
disposed.
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: beam-playground


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to