Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - Stream event not catch #350

Open
Clement-Marchais-Wiztivi opened this issue Nov 7, 2023 · 4 comments
Open

BUG - Stream event not catch #350

Clement-Marchais-Wiztivi opened this issue Nov 7, 2023 · 4 comments
Labels
Android Appcast need more information Further information is requested

Comments

@Clement-Marchais-Wiztivi
Copy link

Clement-Marchais-Wiztivi commented Nov 7, 2023

Description

I'm currently facing some problem on the new evaluationStream. I'm using appcast file and the widget UpgradeAlert don't always receive the new boolean UpgraderEvaluateNeed.

Does anyone have the same problem ??

Implementation

return UpgradeAlert(
      navigatorKey: navigatorStateKey,
      upgrader: Upgrader(
        appcastConfig: AppcastConfiguration(
          url: 'link',
          supportedOS: ['android'],
        ),
        debugLogging: true,
        debugDisplayAlways: true,
        durationUntilAlertAgain: Duration.zero,
      ),
      child: child,
    );

In the build of UpgradeAlert widget , the streamBuilder don't seem to receive the last value of evaluationStream. First value received is false, the one by default but in the function initialize of the Upgrader class if the streamController emit a new value true the streamBuilder is not update and don't check the version

Additional information

I/flutter ( 3703): upgrader: instantiated.
I/flutter ( 3703): upgrader: initialize called
I/flutter ( 3703): upgrader: build UpgradeAlert
I/flutter ( 3703): upgrader: initializing
I/flutter ( 3703): upgrader: languageCode: en
I/flutter ( 3703): upgrader: default operatingSystem: android XX
I/flutter ( 3703): upgrader: operatingSystem: android
I/flutter ( 3703): upgrader: isAndroid: true, isIOS: false, isLinux: false, isMacOS: false, isWindows: false, isFuchsia: false, isWeb: false
I/flutter ( 3703): upgrader: package info packageName: XX
I/flutter ( 3703): upgrader: package info appName: XX
I/flutter ( 3703): upgrader: package info version: 1.8.0
I/flutter ( 3703): upgrader: instantiated.
I/flutter ( 3703): upgrader: build UpgradeAlert
I/flutter ( 3703): upgrader: appcast item count: 1
I/flutter ( 3703): upgrader: appcast best item version: 1.8.1
I/flutter ( 3703): upgrader: appcast critical update item version: null
   upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      sha256: "889c1ece7af143df32e8ee2126f2ef17b2ab6bb7ed8fc3b1b022d7faa4fdab20"
      url: "https://pub.dev"
    source: hosted
    version: "8.2.0"
@larryaasen larryaasen added bug Something isn't working Android Appcast labels Nov 8, 2023
@mdanics
Copy link

mdanics commented Nov 11, 2023

I'm experiencing this too. Downgrading to version 7.1.0 seems to be a short term fix

@Clement-Marchais-Wiztivi
Copy link
Author

I also found a solution using the last version by forcing the check :

final bool isInitialize = await upgrader.initialize();
final bool shouldDisplayUpgrade = upgrader.shouldDisplayUpgrade();

if (isInitialize && shouldDisplayUpgrade) {
  upgrader.checkVersion(context: context);
}

Not really correct .. but it work

@larryaasen
Copy link
Owner

@Clement-Marchais-Wiztivi I tried but I am unable to reproduce this issue. Do you have any more details that might be helpful in understanding this problem? Is there any more of the upgrader log you can share? Is it possible that UpgradeAlert is no longer in the widget tree?

@larryaasen larryaasen added need more information Further information is requested and removed bug Something isn't working labels Nov 28, 2023
@joymyr
Copy link

joymyr commented Dec 5, 2023

Looks similar to my issue where willDisplayUpgrade isn't called when the app starts after being started previously. This can easily be reproduced by using Hot Restart.
This was very noticeable for the user as the app would just show a loadingindicator forever, because in my implementation the app was blocked until it got this response (I want to be able to force upgrade). They had to kill the app and start it again to make it work.
My current production workaround is to wrap the UpgradeAlert in a 5 sec timeout, and just continue if there's no response, as well as logging this to Firebase. The last 7 days this happened about 350 times.
I'm testing a bit more now, and it seems like the issue is resolved by just calling upgrader.shouldDisplayUpgrade() on the UpgradeAlert, as this triggers willDisplayUpgrade. Not sure if this is the optimal solution though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Appcast need more information Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants