GetMetaMap / metamap-flutter-plugin

Flutter plugin for Mati SDK
MIT License
2 stars 8 forks source link

Cancelling the flow gets stuck in cancelled state #2

Closed chjdev closed 3 years ago

chjdev commented 3 years ago

We are listening for SDK events as described:

    matiSubscription = MatiFlutter.resultCompleter.future.asStream().listen((event) {
      log('KYC $event');
    });

Our code works for completing the flow successfully, however if we cancel the flow (via X -> cancel) all subsequent events will be cancelled events.

We tried different approaches with restarting the flow however it seems to be reliant on an internal state that doesn't get reset.

Tested on iOS 14.6 with

  - Mati-Global-ID-SDK (3.2.3)
  - mati_plugin_flutter (2.0.0):
    - Flutter
    - Mati-Global-ID-SDK
aposnovmati commented 3 years ago

Hello @chjdev sorry for the long wait for the answer, we will investigate it and return to you next week.

chjdev commented 3 years ago

@aposnovmati it's been a while now, any updates on this?

aposnovmati commented 3 years ago

Hello @chjdev Is it possible to somehow configure/change the logic of your app with the plugin so that it works? coz i think we can take this issue to research only at end of this month

chjdev commented 3 years ago

thank you for your response, we're pretty sure having resultCompleter as a global static final is to blame for the behavior.

only investigating this at the end of the month is frankly disappointing.

aposnovmati commented 3 years ago

Hello @chjdev we have just taken your issue to investigation and will return to you later this week

aposnovmati commented 3 years ago

Hello @chjdev could you try, please new 2.3.1 version, we will wait for your feedback

dev-whjc commented 3 years ago

It worked, thank you!

Unfortunately, the resultCompleter is now untyped/dynamic but we can cast it to Future<Result>.