Chat and gCLI are run in different threads, and are not thread safe. Which is a non-issue, until we introduce the chat script functionality.
If asked I could whip up something to reproduce this. But generally that would just be a chat script spamming a pref modification while a script in gCLI spams a pref modification until an error is thrown where the preferences were concurrently modified. This isn't just related to preferences only, chat scripts can do more than that after all.
Most people may not use a chat script, but it does have its uses. I myself like to use it to send myself a "chat_notify" when someone mentions me, and to communicate with other bots with the responding messages saved into a pref which the main script reads to decide the course of action. (Cagebots)
I'm not sure what a perfect solution for this would be, my current train of thought is that only one runtime_function can be called from any thread at a time.
Though for nested runtime executions, like a chat script running a cli command, or calling a cli command that calls a script that calls a cli command. I'm not sure.
Another consideration could be that chat script execution is now performed on the main thread, though what that would look like exactly I'm again not sure.
Putting aside what a chat script should and shouldn't be possible to do, setting preferences should be well within the list of possibilities.
If asked I could whip up something to reproduce this. But generally that would just be a chat script spamming a pref modification while a script in gCLI spams a pref modification until an error is thrown where the preferences were concurrently modified. This isn't just related to preferences only, chat scripts can do more than that after all.
Most people may not use a chat script, but it does have its uses. I myself like to use it to send myself a "chat_notify" when someone mentions me, and to communicate with other bots with the responding messages saved into a pref which the main script reads to decide the course of action. (Cagebots)
I'm not sure what a perfect solution for this would be, my current train of thought is that only one runtime_function can be called from any thread at a time.
Though for nested runtime executions, like a chat script running a cli command, or calling a cli command that calls a script that calls a cli command. I'm not sure.
Another consideration could be that chat script execution is now performed on the main thread, though what that would look like exactly I'm again not sure.
Putting aside what a chat script should and shouldn't be possible to do, setting preferences should be well within the list of possibilities.