encointer / encointer-wallet-flutter

Encointer mobile wallet flutter implementation

Home Page:https://encointer.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unregistering participant fails to pop loading dialogue due to outdated context

clangenb opened this issue · comments

Probably some kind of race condition as this is where integration tests sometimes fail, and now it occurred on my simulator too:

E/flutter (20752): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
E/flutter (20752): At this point the state of the widget's element tree is no longer stable.
E/flutter (20752): To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
E/flutter (20752): #0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure> (package:flutter/src/widgets/framework.dart:4558:9)
E/flutter (20752): #1      Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:4572:6)
E/flutter (20752): #2      Element.findAncestorStateOfType (package:flutter/src/widgets/framework.dart:4643:12)
E/flutter (20752): #3      Navigator.of (package:flutter/src/widgets/navigator.dart:2623:40)
E/flutter (20752): #4      Navigator.pop (package:flutter/src/widgets/navigator.dart:2507:15)
E/flutter (20752): #5      UnregisteredLinkButton.build.<anonymous closure> (package:encointer_wallet/page-encointer/ceremony_box/components/unregister_link_button.dart:30:21)
E/flutter (20752): <asynchronous suspension>

Haha, wow this seems to occur consistently after the change to send txs in dart because of more reliable timings. This is caused because the parent of the dialog is the unregister button, which disappears immediately after the tx unregistering has been done. As a result popping the dialog with the parent gone fails.