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

[iOS] Upgrader Dialog Does Not Work Well After User Returns From the AppStore #441

Open
achrafmam2 opened this issue Sep 1, 2024 · 1 comment

Comments

@achrafmam2
Copy link

Steps to reproduce:

  1. Open App
  2. Assuming the binary App is OLD, a dialog is shown
  3. Click on Update
  4. User is taken to the App store, return back to app WITHOUT updating
  5. Click on Update

Expected Behavior: User is taken to the store
Current Behavior: Alert Dialog is popped

flutter: upgrader: UpgraderAppcastStore: version info: appStoreListingURL: <redacted>, appStoreVersion: 0.3.11, installedVersion: 0.3.10, isCriticalUpdate: true, minAppVersion: null, releaseNotes: New version
flutter: upgrader: need to evaluate version
flutter: upgrader: blocked: true
flutter: upgrader: debugDisplayAlways: false
flutter: upgrader: debugDisplayOnce: false
flutter: upgrader: hasAlerted: false
flutter: upgrader: installedVersion: 0.3.10
flutter: upgrader: minAppVersion: null
flutter: upgrader: isUpdateAvailable: true
flutter: upgrader: shouldDisplayUpgrade: true
flutter: upgrader: shouldDisplayReleaseNotes: false
flutter: upgrader: current locale: fr
flutter: upgrader: languageCode: fr
flutter: upgrader: showTheDialog title: Mettre à jour l'application ?
flutter: upgrader: showTheDialog message: Une nouvelle version de <redacted> est disponible ! La version 0.3.11 est maintenant disponible, vous avez la version 0.3.10.
flutter: upgrader: showTheDialog releaseNotes: null
flutter: upgrader: onCanPop called
flutter: upgrader: button tapped: update now
flutter: upgrader: launching: <redacted>
flutter: upgrader: instantiated
flutter: upgrader: build UpgradeAlert
flutter: upgrader: need to evaluate version
flutter: upgrader: instantiated
flutter: upgrader: build UpgradeAlert
flutter: upgrader: need to evaluate version
flutter: upgrader: current locale: en_US
flutter: upgrader: countryCode: US
flutter: upgrader: languageCode: en
flutter: upgrader: UpgraderAppcastStore item count: 1
flutter: upgrader: UpgraderAppcastStore best item version: 0.3.11
flutter: upgrader: UpgraderAppcastStore critical update item version: 0.3.11
flutter: upgrader: UpgraderAppcastStore: version info: appStoreListingURL: <redacted>, appStoreVersion: 0.3.11, installedVersion: 0.3.10, isCriticalUpdate: true, minAppVersion: null, releaseNotes: New version

Also, please include the upgrader version number from the pubspec.lock file, which should look something like this:

  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      sha256: d45483694620883107c2f5ca1dff7cdd4237b16810337a9c9c234203eb79eb5f
      url: "https://pub.dev"
    source: hosted
    version: "10.3.0"

Code

return MaterialApp.router(
      theme: MainTheme().light(),
      routerConfig: defaultAppRouter,
      localizationsDelegates: localizationsDelegates,
      supportedLocales: supportedLocales,
      scrollBehavior: const MaterialScrollBehavior().copyWith(
        dragDevices: {
          PointerDeviceKind.touch,
          PointerDeviceKind.mouse,
        },
      ),
      builder: (context, child) {
        const appcastURL = String.fromEnvironment("appcastUrl");
        final upgrader = Upgrader(
          storeController: UpgraderStoreController(
            oniOS: () => UpgraderAppcastStore(appcastURL: appcastURL),
            onAndroid: () => UpgraderAppcastStore(appcastURL: appcastURL),
          ),
          debugLogging: kDebugMode,
        );

        return UpgradeAlert(
          navigatorKey: defaultAppRouter.routerDelegate.navigatorKey,
          upgrader: upgrader,
          showReleaseNotes: false,
          child: child ?? Container(),
        );
      },
    );
  }
@achrafmam2
Copy link
Author

achrafmam2 commented Sep 1, 2024

I tried to root cause the issue but didn't find the main culprit, but the UpgraderState::versionInfo gets null at some point. I've put several breakpoints but wasn't able to find where it gets null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant