DEV: fix flakey by duplicating constant (#29636)

This is because rules is pointing to the same array MARKDOWN_IT_RULES, which is modified directly. Modifying rules with << changes the original MARKDOWN_IT_RULES array, so every call to something works with the altered array state from previous calls.
This commit is contained in:
Joffrey JAFFEUX 2024-11-07 23:51:17 +09:00 committed by GitHub
parent 5010fced92
commit 4840060568
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,7 +223,7 @@ module Chat
]
def self.cook(message, opts = {})
rules = MARKDOWN_IT_RULES
rules = MARKDOWN_IT_RULES.dup
rules << "heading" if opts[:user_id] && opts[:user_id].negative?
# A rule in our Markdown pipeline may have Guardian checks that require a