Skip to content

fix: avoid mutating feedmap when listing feeds#239

Merged
uforia merged 1 commit into
mainfrom
fix/feedmap-rendering-no-mutate
May 31, 2026
Merged

fix: avoid mutating feedmap when listing feeds#239
uforia merged 1 commit into
mainfrom
fix/feedmap-rendering-no-mutate

Conversation

@spierenburg
Copy link
Copy Markdown
Collaborator

@spierenburg spierenburg commented May 18, 2026

What this PR brings

  • Changes the !feeds / @feeds rendering path to work on a copy of each topic's feed list.

Why it matters

The previous code assigned:

availablefeeds = self.feedmap['TOPICS'][topic]

and then removed enabled feeds from availablefeeds while building the display table. Because that variable referenced the real list inside self.feedmap, simply viewing the feed list could mutate in-memory feed state.

This PR makes feed listing read-only by using list(...) before removing entries for display purposes.

Validation

python3 -m py_compile matterbot.py

@uforia uforia merged commit 3a6ebf0 into main May 31, 2026
5 checks passed
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.

2 participants