A chat channel doesn’t show nor save messages

Hi @Jagster , I am on the chat team as well and I’m looking into this a bit further. Reading over what you have done, none of that should have caused this error. Each chat message is potentially linked to a chat thread in the database via a thread_id, and one of your messages has a thread_id for a thread that does not exist for…some reason. We don’t have any code to delete threads, so perhaps there was some update that went awry.

Can you try running this query for me and post the results? It will let us see whether you have a widespread issue or if it was just one strange edge case:

SELECT id, chat_channel_id, thread_id
FROM chat_messages
WHERE thread_id IS NOT NULL AND thread_id NOT IN (
  SELECT id FROM chat_threads
);