Repository navigation
fix (gql-server): Set typing=false once user edited a message - #24999
antobinary merged 1 commit into
Conversation
WalkthroughA SQL database trigger in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@bbb-graphql-server/bbb_schema.sql`:
- Line 1328: The trigger update_chatUser_clear_lastTypingAt_trigger currently
fires on any UPDATE of chat_message; restrict it to only edit-related updates by
changing the trigger definition to fire only for the edit columns (e.g., use
UPDATE OF "message", "editedAt" ON chat_message or add a WHEN condition
comparing OLD and NEW for "message" and "editedAt"), so only edits clear
lastTypingAt; keep the trigger body and name unchanged and ensure the new
definition references the chat_message table and the "message" and "editedAt"
columns.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a310491a-a653-40ac-b117-f94289a6b438
📒 Files selected for processing (1)
bbb-graphql-server/bbb_schema.sql
| $$ LANGUAGE plpgsql; | ||
|
|
||
| CREATE TRIGGER "update_chatUser_clear_lastTypingAt_trigger" AFTER INSERT ON chat_message FOR EACH ROW | ||
| CREATE TRIGGER "update_chatUser_clear_lastTypingAt_trigger" AFTER INSERT OR UPDATE ON chat_message FOR EACH ROW |
There was a problem hiding this comment.
Scope the UPDATE trigger to edit-related columns only.
On Line 1328, AFTER ... UPDATE fires for any update on chat_message, so unrelated updates can clear lastTypingAt for the sender unexpectedly. Limit update events to edit fields (e.g., "message", "editedAt").
Suggested change
-CREATE TRIGGER "update_chatUser_clear_lastTypingAt_trigger" AFTER INSERT OR UPDATE ON chat_message FOR EACH ROW
+CREATE TRIGGER "update_chatUser_clear_lastTypingAt_trigger"
+AFTER INSERT OR UPDATE OF "message", "editedAt" ON "chat_message"
+FOR EACH ROW
EXECUTE FUNCTION "update_chatUser_clear_lastTypingAt_trigger_func"();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| CREATE TRIGGER "update_chatUser_clear_lastTypingAt_trigger" AFTER INSERT OR UPDATE ON chat_message FOR EACH ROW | |
| CREATE TRIGGER "update_chatUser_clear_lastTypingAt_trigger" | |
| AFTER INSERT OR UPDATE OF "message", "editedAt" ON "chat_message" | |
| FOR EACH ROW | |
| EXECUTE FUNCTION "update_chatUser_clear_lastTypingAt_trigger_func"(); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@bbb-graphql-server/bbb_schema.sql` at line 1328, The trigger
update_chatUser_clear_lastTypingAt_trigger currently fires on any UPDATE of
chat_message; restrict it to only edit-related updates by changing the trigger
definition to fire only for the edit columns (e.g., use UPDATE OF "message",
"editedAt" ON chat_message or add a WHEN condition comparing OLD and NEW for
"message" and "editedAt"), so only edits clear lastTypingAt; keep the trigger
body and name unchanged and ensure the new definition references the
chat_message table and the "message" and "editedAt" columns.
0bc0b6a
into
bigbluebutton:v3.0.x-develop
🚨 Automated tests failed |



When a user sends a message, the database automatically assumes they stopped typing.
That behavior was not applied when a message was edited, so after editing, the user could still appear as typing.
This PR fixes that by marking the user as having stopped typing as soon as they edit a message.