Keywords interned from user input #2

Closed
opened 2022-03-23 20:21:38 +01:00 by sm2n · 2 comments
Owner

856432516c/src/bot.clj (L11)

The bot interns game names here. This won't actually matter for what we use the bot for because we don't have a spam problem; but this is a bad idea because keywords are not garbage collected, so if people enter and remove a lot of game names it will leak memory. I would suggest just using the raw strings as map keys instead.

https://git.libregaming.org/LibreGaming/matchbot/src/commit/856432516c7ee17b0cfbe8ea008f6d2b9d72e088/src/bot.clj#L11 The bot interns game names here. This won't actually matter for what we use the bot for because we don't have a spam problem; but this is a bad idea because keywords are not garbage collected, so if people enter and remove a lot of game names it will leak memory. I would suggest just using the raw strings as map keys instead.
Owner

I think this can be done as a non-breaking change, as the keys are stored as regular strings in serialised JSON when at rest. Thus, we would need only to remove the function that you referenced and unset the key-fn function in 856432516c/src/system.clj (L22) in order to change this behaviour.

I think this can be done as a non-breaking change, as the keys are stored as regular strings in serialised JSON when at rest. Thus, we would need only to remove the function that you referenced and unset the `key-fn` function in https://git.libregaming.org/LibreGaming/matchbot/src/commit/856432516c7ee17b0cfbe8ea008f6d2b9d72e088/src/system.clj#L22 in order to change this behaviour.
seabass added this to the 1.0.1 milestone 2022-03-23 20:39:52 +01:00
seabass added a new dependency 2022-03-30 15:56:14 +02:00
Owner

Resolved in pull request #6.

Resolved in pull request #6.
Sign in to join this conversation.
No Label
security
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: LibreGaming/matchbot#2
No description provided.