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

Fix console exception with panel logger enabled #1867

Merged
merged 2 commits into from
Oct 16, 2021
Merged

Fix console exception with panel logger enabled #1867

merged 2 commits into from
Oct 16, 2021

Conversation

rchl
Copy link
Member

@rchl rchl commented Oct 3, 2021

After window is closed, the server messages can keep coming for a while
and the "is_valid()" check doesn't really work as expected for closed
Window so we need to do the "is in" check instead.

After window is closed, the server messages can keep coming for a while
and the "is_valid()" check doesn't really work as expected for closed
Window so we need to do the "is in" check instead.
@rchl
Copy link
Member Author

rchl commented Oct 3, 2021

When checking the "Window.is_valid()" in the console it seems to work but I guess there is a small time frame after the tab is removed where it will still be reporting is_valid() == True

@predragnikolic
Copy link
Member

and the "is_valid()" check doesn't really work as expected for closed

is this a ST bug?

For me this PR looks like it adds additional logic, but the benefit is not so obvious.
Was there a reason for this PR? (some bug, degraded performance issue of some sort)

@rchl
Copy link
Member Author

rchl commented Oct 12, 2021

and the "is_valid()" check doesn't really work as expected for closed

is this a ST bug?

For me this PR looks like it adds additional logic, but the benefit is not so obvious. Was there a reason for this PR? (some bug, degraded performance issue of some sort)

I often see exceptions in the console when the server starts in some window and I close the window soon after it started. The WindowPanelListener.server_log_map[window_id] throws because given window_id was already removed from the map.

It's not necessarily a bug in ST. We are removing the id from the map from on_pre_close_window so technically it can still be valid for a while after we've removed it.

@rwols rwols merged commit 1c9eb15 into main Oct 16, 2021
@rwols rwols deleted the fix/log-error branch October 16, 2021 20:38
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.

3 participants