Open AhmedLSayed9 opened 10 months ago
I think the error occurs because we pass a different Upgrader
instance to UpgradeAlert
.
But I need to pass a different Upgrader
instance with different minAppVersion
. This is necessary when we use minAppVersion
from Remote Config which can be updated in real time and force current users to stop using the app.
@AhmedLSayed9 I assume the problem is that you are instantiating Upgrader multiple times. As you can see in this example, you should use a final variable with Upgrader: https://github.com/larryaasen/upgrader/blob/f7f0e7da00b809e61ea2f55d8e0d0d0d074aa7f0/example/lib/main-min-app-version.dart#L26C29-L26C29
I see.
I think we can avoid that by storing the Upgrader
instance at the state class internally to avoid such mistakes.
Also, I was expecting to be able to update minAppVersion
at runtime and re-evaluate UpgradeAlert.
Can I open a PR that offer a solution for both things? Let me know if it should land on master
or custom
.
@larryaasen Can you look into this? I've already fixed it in a forked repo, exactly at https://github.com/AhmedLSayed9/upgrader/commit/8f743dbb027b5c0262dbbcc029cdb5a8357f6099. Let me know If I should open a PR with the fix.
The fix allowed me to re-evaluate and show UpgradeAlert again when minAppVersion
changes "using remote config real time updates".
@AhmedLSayed9 I looked at your code briefly and I wonder if that change will pass the unit tests. You can submit a PR if you would like and I can enable the CI action to run and review the unit test results.
I've forgotten about this.
PR is submitted now :)
I don't think this is an issue anymore with the latest changes in version 10.0.0. You should now be able to avoid this:
The fix allowed me to re-evaluate and show UpgradeAlert again when minAppVersion changes "using remote config real time updates".
I don't think this is an issue anymore with the latest changes in version 10.0.0. You should now be able to avoid this:
I've tested it again with version 10.3.0
and the issue still exists.
@larryaasen Can you give a look? Let me know if I should fix my PR.
I've fixed my PR.
Using the following sample from the examples with a button added to perform a rebuild:
First build is done without errors. but if I ignore the dialog and press the button to perform a rebuild, the following error is thrown:
the upgrader log: