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

iOS/Safari - Lost chat in background #53

Open
EngineLessCC opened this issue May 10, 2023 · 6 comments
Open

iOS/Safari - Lost chat in background #53

EngineLessCC opened this issue May 10, 2023 · 6 comments

Comments

@EngineLessCC
Copy link

Whenever I send some input and put my device in standby or the app in background while the answer is being written, both my input as well as the GPT answer get erased from chat history.

Likely a bug?

I'd prefer my input wouldn't be lost and even if the response is not complete, that the received data remains as well.

iOS 16.4.1 (a) - iPhone 13 Pro Max

@Shackless
Copy link
Contributor

Shackless commented Jul 3, 2023

This has to do with how your browser is suspended in iOS. When you minimize, the browser goes to "sleep" and cancels running requests. We call the OpenAI completion API as eventstream, so this stream gets terminated. Then SlickGPT realizes (correctly) that the answer stream was ended abruptly and removes the incomplete message (and your last prompt in addition to that) from the chat history.

I don't think we can do much there as long as SlickGPT is just running in the browser instead of a native app.

The better "fix" or workaround would probably be to allow disabling completion streaming so that it's a single request and response instead of a stream. There is another issue for that but it's a bit more complicated to implement. I'll close this issue for now but I have the problem in mind.

@Shackless Shackless closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
@EngineLessCC
Copy link
Author

why not have SlickGPT keep the incomplete message instead of removing it? (With a simple warning about being incomplete)

The issue was not about the terminated stream as that is obvious, the issue was about the wrong behaviour on resume

@Shackless Shackless reopened this Jul 3, 2023
@Shackless
Copy link
Contributor

Shackless commented Jul 3, 2023

I just tried on my iPhone 13 Pro with Safari and if I minimize the browser and lock my phone while the completion is being generated, it continues receiving in the background. When I unlock the phone later and reopen Safari, the answer is displayed correctly. Do you have special battery saver options enabled or something like that?

I did make a change in the past to keep incomplete answers (to implement the "stop generating" button). This should theoretically cover it. Could you please retest?

@EngineLessCC
Copy link
Author

Okay I retested:
gpt4, "Give me a random sentence with 50 words".
Went to standby, waited 10 seconds, resumed, and my message + response are gone.

I'm not using any special battery savings or webkit settings.

@Shackless
Copy link
Contributor

Ok weird, thanks. I'll investigate. I did the exact same thing with 300 words and waited like 30 seconds...

@EngineLessCC
Copy link
Author

Just for completeness, here are 2 screenshots: Before standby, after standby:

image
image

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

2 participants