mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:43:15 +08:00
9c39053d6f
What is the problem? Previously, this was the query used to move change messages into another channel. ``` INSERT INTO chat_messages( chat_channel_id, user_id, last_editor_id, message, cooked, cooked_version, created_at, updated_at ) SELECT :destination_channel_id, user_id, last_editor_id, message, cooked, cooked_version, CLOCK_TIMESTAMP(), CLOCK_TIMESTAMP() FROM chat_messages WHERE id IN (:message_ids) RETURNING id ``` The problem is that this incorrectly assumes that the insertion will be based on the order of `message_ids`. However, that is not the case as PostgreSQL provides no such guarantee. Instead we need to explicitly order the messages to ensure the right order of insertion. This problem was discovered by a flaky test which exposed the non-guarantee order of insertion. |
||
---|---|---|
.. | ||
app | ||
assets | ||
config | ||
db | ||
lib | ||
public | ||
spec | ||
test/javascripts | ||
plugin.rb | ||
README.md |
This plugin is still in active development and may change frequently
Documentation
The Discourse Chat plugin adds chat functionality to your Discourse so it can natively support both long-form and short-form communication needs of your online community.
For user documentation, see Discourse Chat.
For developer documentation, see Discourse Documentation.