-
Notifications
You must be signed in to change notification settings - Fork 294
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
Clear cell output doesn't always work #5446
Comments
Sounds like a bug in vscode, since we now never update output directly this looks like it's on them |
@rebornix @roblourens |
Seems like this is harder to repro today, but I can still see it. Looking at logs, when I click Clear and this reproes, the extension prints "Trusting notebook" and stops printing the "Update streamed output" messages, which makes me think the extension is doing something weird. The next logs are from when I clicked stop.
|
Wait, thats odd, we why's the cell getting interrupted when you haven't clicked interrup. Based on what you're trying & What @joyceerhl is trying, we're only clearing output. Hmmn. |
@DonJayamanne The logs Rob provided are a result of clicking the cell stop button, so I think it makes sense that the cell is getting interrupted. And yes I can still repro this 😕 |
I too can repro this issue. Changing to high priority & adding to May milestone as this would be a regression for us (we've had plenty of complaints in the past for similar issues) |
Found it, its both ends. @roblourens
|
I guess you are replacing output on an output item that was deleted in the renderer process by the clear command. I get it now. I am not sure what the right move is. We could implement "clear outputs" in the extension host. Or in this scenario, we could create a new output to wrap the output item. I can't think of any other case where the frontend is modifying outputs, so this is a special scenario. @rebornix? Btw, any reason you aren't using appendOutputItems instead of replace? Looks like you are re-sending all the content on each update. |
This was after I discussed this with Jo. As an optimization we can do this only if we detect ansi, but tha'ts a seprate issue. |
I forgot about that. @rebornix suggested you could just be using appendOutput for this but not if you are changing the output to resolve those. But in this case calling append or replaceOutputItems for a removed output should just be a no-op. So I think the only issue is that we throw and should not throw. |
Yes agreed, but that's merely an optimization. E.g. if we're streaming terminal output that contains ANSI, we could run into this same issue (where we keep clearing output). |
Wouldn't the data then get lost? I.e. we'd keep calling I think the only way is for us (extension) to know that the output is not longer valid. |
It's ok for the data to be lost because the output was deleted. But I think that when there are no outputs, you call appendOutput to create a new output, and after that add output items to that. So once the output changes are synced back to the EH a few ms later, things will be good again. After you click "clear", there is a short window where an output may be produced, but lost, and this window depends on EH latency but I think this is the right behavior. Either that or we go back to a model where an edit can fail to be applied and the extension has to retry, which is not what we want. |
Fixed in microsoft/vscode#121687 |
Validated. Tried the original repro 5 times and everything works as expected. Thank you @roblourens! |
The text was updated successfully, but these errors were encountered: