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

Blocking UI updates when updating #104

Closed
ewindso opened this issue Feb 14, 2025 · 9 comments
Closed

Blocking UI updates when updating #104

ewindso opened this issue Feb 14, 2025 · 9 comments

Comments

@ewindso
Copy link
Contributor

ewindso commented Feb 14, 2025

Thanks for making this! One thing I notice is that when I check for an update after come back from the background, the UI seems blocked. This doesn't happen when it's initially updating using the same method (runUpdateProcess).

However when coming back from the background, it also checks for an update -- and if there is one, the UI is blocked from interaction. (ScrollViews scroll, but taps do not work, cannot do anything else.) Also, even the progress from useHotUpdaterStore seems not to update.

This is on iOS. I haven't yet gotten to Android, just wanting to get past this. One potential workaround I see is showing a full-screen splash screen, with a spinner (loading progress won't work since it can't update UI...)

Any help on fixing it would be appreciated! Thank you.

@gronxb
Copy link
Owner

gronxb commented Feb 14, 2025

Could you provide a reproduction code?

@mstfmedeni
Copy link
Contributor

I noticed something similar in ios, there is no problem when I forceupdate. fallbackComponent is shown and reload works successfully, but when forceupdate is false. when the application is first opened, the ui is blocked during the update time, fallbackComponent is not shown and navigation operations do not occur because the ui is blocked.

version 0.7.0

@ewindso
Copy link
Contributor Author

ewindso commented Feb 15, 2025

@gronxb @mstfmedeni I think the issue is with the native updateBundle method, how it uses dispatch_semaphore_wait. According to ChatGPT, it blocks the thread it's called on. I forked and am going to try a dispatch_async around it to see if that helps, when calling it from the RN method. If so, will post a PR here.

@gronxb I would provide a JS example but the way our project does updates (or used to do them in CodePush) is a little complex.

@ewindso
Copy link
Contributor Author

ewindso commented Feb 15, 2025

Ok @gronxb @mstfmedeni this seems to fix it:

#106

@mstfmedeni
Copy link
Contributor

@ewindso It seems to be fixed. thank you for your support and feedback

@gronxb
Copy link
Owner

gronxb commented Feb 16, 2025

#106

@gronxb gronxb closed this as completed Feb 16, 2025
@ewindso
Copy link
Contributor Author

ewindso commented Feb 17, 2025

@gronxb @mstfmedeni just fyi sending events was happening too quick for me on iOS, UI thread was getting clogged... I added this in, seems to fix:

#111

@minhchienwikipedia
Copy link

minhchienwikipedia commented Feb 21, 2025

I got the same issue with the latest version (v0.12.0) on Android.
When I release a new hot update version -> open the app -> it checks checking new version and gets block UI

@gronxb
Copy link
Owner

gronxb commented Feb 21, 2025

@minhchienwikipedia Can you provide video or reproduction?

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

4 participants