Skip to content

Fix KeyError in _remove_buddy by safely handling missing buddy keys#1090

Open
AYUSH676-JARVIS wants to merge 3 commits intosugarlabs:masterfrom
AYUSH676-JARVIS:fix-keyerror-buddy
Open

Fix KeyError in _remove_buddy by safely handling missing buddy keys#1090
AYUSH676-JARVIS wants to merge 3 commits intosugarlabs:masterfrom
AYUSH676-JARVIS:fix-keyerror-buddy

Conversation

@AYUSH676-JARVIS
Copy link
Copy Markdown

Fix KeyError in _remove_buddy in meshbox.py.

The crash occurs when buddy_model.props.key is not present in the _buddies dictionary. This PR adds a safe check and logging to handle the situation gracefully and prevent crashes during inconsistent Telepathy states.

@AYUSH676-JARVIS
Copy link
Copy Markdown
Author

AYUSH676-JARVIS commented Mar 23, 2026

Fixes #840
I investigated the issue and found that the crash is caused by a KeyError in _remove_buddy when the buddy key is missing. I have submitted a fix to handle this safely.

@AYUSH676-JARVIS
Copy link
Copy Markdown
Author

Hi, I have submitted a PR fixing the KeyError and improving buddy state consistency. Would appreciate feedback. Thanks!

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