You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: initial sync on Preview app (Android) leads to loop
When `tns preview` command is executed and the QR code is scanned with Android device, the Preview app on this device asks for initial sync of the files. At this point CLI starts preparing the project and once the files are prepared, it sends them to device.
However, this operation may take some time, especially for code sharing projects, which have a lot of dependencies and webpack is used. Meanwhile the Preview app on device sees that it had not received the files within 10 seconds and sends a new message to get the initial files.
So CLI starts another process of preparation and trying to sync the changes. Based on the time required, this may become an indefinite loop.
Fix this by caching the promise for initial sync and in case device asks again, CLI will use the already pending promise.
Also fix the case where another device from the same platform is used to scan the QR code at some point. Currently we've not passed device identifier to pubnub and the initial sync was sending the files to all devices in the mentioned scenario.
0 commit comments