Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

class Comment < ApplicationRecord
validates :author, :text, presence: true
after_commit { CommentRelayJob.perform_later(self) }
after_create_commit { CommentRelayJob.perform_later(self) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Broadcasting silently dropped for updates and destroys

after_create_commit only fires after an INSERT, so comment edits and deletes no longer enqueue CommentRelayJob. The app exposes both update and destroy actions via CommentsController, so any client subscribed to the "comments" ActionCable channel will continue to see stale data after a comment is edited or deleted. If real-time updates on create are the only required behaviour this is fine, but the PR description frames it purely as a performance improvement, which obscures the functional trade-off.

end