-
When the AI SDK is streaming data, and a mobile device goes to the lock screen (ie, iPhone) , the data stream is halted and fails. Has anyone seen this issue? How to prevent/fix this? Edge/Chrome browser issue. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I don't think this is something we can fix; iOS is putting the browser process to sleep which subsequently kills the stream. I have no idea if something like https://github.com/richtr/NoSleep.js works on newer devices, but if you really want this this is likely your best bet. A better solution would involve storing the results (on the server) in a database and retrieving them when the user reconnects if they aren't the same client that initiated it. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the heads up on what I should be looking for. I ended up finding this which was exactly what I needed: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API |
Beta Was this translation helpful? Give feedback.
Thanks for the heads up on what I should be looking for. I ended up finding this which was exactly what I needed:
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API