Disallow restart doesn't seem to be working for me.
I have installMode set to ON_NEXT_RESUME and am setting disallowRestart in a componentDidMount. The app is logging the disallow restart but still restarts on resume after disallowRestart is called.
Can anyone please help?
Hi @claykohut, thanks for reaching us. I've investigated the issue, seems like there is a mismatch between the documentation and implementation. Documentation says that disallowRestart works with InstallMode.ON_NEXT_RESUME, but from the source code I can see the following:
disallowRestart method affects RestartManager.restartApp methodRestartManager.restartApp is used by install method only in case InstallMode.IMMEDIATE is in use_allowed flag does not used by native side. As result disallowRestart feature works for InstallMode.IMMEDIATE only. For now we are working on Support Brownfield React Native apps feature, so we'll move _allowed flag to the native side and use it further for ON_NEXT_RESUME, ON_NEXT_SUSPEND https://github.com/Microsoft/react-native-code-push/pull/770 and IMMEDIATE installation modes, so the issue will be fixed.
Please let me know if you have any questions.
@sergey-akhalkov any idea when this might make it into a release?
Hi @joeferraro, thanks for reaching us. We've already implemented "Support for Brownfield React Native apps" feature that also includes this improvement, here you can find my fork. Here you can see native RestartManager where the issue is fixed.
The main problem why we aren't merging this is that we need to test "Support for Brownfield React Native apps" very carefully and deeply to avoid as much issues as possible. So currently we are testing this, so we will be very grateful if you could help us to test it if possible.
@amardeepranu thanks for the interest, we are planning to release a new version including fix for that during this month.
Has this been release yey, and does it also apply to ON_NEXT_SUSPEND, the docs only mention ON_NEXT_RESUME at the moment.
Hi @MrLoh, thanks for reaching us.
Has this been release yey
Unfortunately, no, currently we have other priorities, but we'll back to this asap.
and does it also apply to ON_NEXT_SUSPEND, the docs only mention ON_NEXT_RESUME at the moment.
after releasing "support for brownfield apps" feature it will support both ON_NEXT_RESUME and ON_NEXT_SUSPEND
Any updates? This has been idle for almost an year.
not fix yet
Please have a Look at this
https://github.com/Microsoft/react-native-code-push/issues/1550
I think I'm noticing this issue for my app as well. Commented on https://github.com/microsoft/react-native-code-push/issues/1667#issuecomment-549440553 with some context but I'll repeat it here:
This is happening on React Native 0.61.3 with installMode set to ON_NEXT_RESUME on Android.
disallowRestart is called and the Disallowing restarts log is present.allowRestart hasn't been called.Hi @achou11 @claykohut @kevinresol
Sorry for the delay.
We have prepared a PR (#1894) to solve this problem, if you have the time and desire, you can take a look at it.
Hi @achou11 @claykohut @kevinresol
We made a new release with this feature, thanks for your participation.
Most helpful comment
Any updates? This has been idle for almost an year.