Skip to content

Prevent crashes when user spams Cmd:T#1404

Merged
esimkowitz merged 2 commits into
mainfrom
evan/fix-spam-tabs
Dec 6, 2024
Merged

Prevent crashes when user spams Cmd:T#1404
esimkowitz merged 2 commits into
mainfrom
evan/fix-spam-tabs

Conversation

@esimkowitz
Copy link
Copy Markdown
Contributor

@esimkowitz esimkowitz commented Dec 6, 2024

When a user spams Cmd:T, a WaveTabView might be created but never end up getting mounted to the window, since another will come along before it can. In these cases, the WaveTabView is essentially in a bad state and attempting to switch to it will result in the window becoming unresponsive. While we could recover it by running waveInit again, it's easier to just dispose of it and treat it as an unloaded tab next time it gets switched to.

This adds a timeout to each WaveTabView where once it gets assigned a tab ID, it has 1 second to respond "ready" or it will be destroyed. This should help prevent resource leakages for these dead views.

@esimkowitz esimkowitz merged commit 3c69237 into main Dec 6, 2024
@esimkowitz esimkowitz deleted the evan/fix-spam-tabs branch December 6, 2024 04:03
xxyy2024 pushed a commit to xxyy2024/waveterm_aipy that referenced this pull request Jun 24, 2025
When a user spams Cmd:T, a WaveTabView might be created but never end up
getting mounted to the window, since another will come along before it
can. In these cases, the WaveTabView is essentially in a bad state and
attempting to switch to it will result in the window becoming
unresponsive. While we could recover it by running waveInit again, it's
easier to just dispose of it and treat it as an unloaded tab next time
it gets switched to.

This adds a timeout to each WaveTabView where once it gets assigned a
tab ID, it has 1 second to respond "ready" or it will be destroyed. This
should help prevent resource leakages for these dead views.
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

Successfully merging this pull request may close these issues.

1 participant