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

Forget closed buffers #58

Merged
merged 4 commits into from
Feb 26, 2024
Merged

Forget closed buffers #58

merged 4 commits into from
Feb 26, 2024

Conversation

mhoran
Copy link
Owner

@mhoran mhoran commented Feb 25, 2024

No description provided.

Also remove unnecessary .eslintignore (node_modules ignored by default.)
While the buffer list is fetched and replaced when (re)connecting,
references to closed buffers may still exist in the hotlist, nicklist,
and line states, as well as the currentBufferId field in the app state.

Ensure that references to closed buffers are cleared out from the other
states when the buffer list is fetched.

Note that there is still a potential issue during upgrades if a pointer
happens to be reused. Checking whether an upgade occurred while offline
would be ideal, but it's an edge case.
@mhoran mhoran force-pushed the forget-closed-buffers branch from 94f52b4 to beb5259 Compare February 25, 2024 14:49
Now that the currentBufferId is properly set to null when an open buffer
disappears (is closed in weechat or while disconnected), currentBufferId
can be referenced without a guard checking buffer state.
@mhoran mhoran merged commit b02cc44 into main Feb 26, 2024
3 of 4 checks passed
@mhoran mhoran deleted the forget-closed-buffers branch February 28, 2024 13:25
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