Skip to content

Fixes #156 - Deprecate "shout" event#488

Open
xprazak2 wants to merge 1 commit intopapercups-io:masterfrom
xprazak2:deprecate-shout
Open

Fixes #156 - Deprecate "shout" event#488
xprazak2 wants to merge 1 commit intopapercups-io:masterfrom
xprazak2:deprecate-shout

Conversation

@xprazak2
Copy link
Copy Markdown

@xprazak2 xprazak2 commented Dec 22, 2020

Deprecate "shout" event for conversation channel
in favor of "message:created".

Issue

#156

@xprazak2
Copy link
Copy Markdown
Author

I think the removal can be done in 3 steps:

  1. Handle message:created and deprecate shout which keeps backward compatibility
  2. Migrate clients to new event name
  3. Remove shout in a future version when clients are migrated

Copy link
Copy Markdown
Collaborator

@reichert621 reichert621 left a comment

Choose a reason for hiding this comment

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

just one small nitpick, and could we also handle this in the notification_channel as well?

thanks!

# It is also common to receive messages from the client and
# broadcast to everyone in the current topic (conversation:lobby).
def handle_in("shout", payload, socket) do
defp handle_in_msg(event_name, payload, socket) do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick -- can we name this something like handle_incoming_message instead? i think it's a bit more explicit :)

also let's move this to the bottom with the other private methods so we can fix the warning below 👍

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I renamed the method and moved it to the bottom - naming is hard ;-)

I also made similar changes in notification_channel.

@xprazak2 xprazak2 force-pushed the deprecate-shout branch 4 times, most recently from 351569b to 2bfd0f6 Compare January 1, 2021 13:43
assert_push("shout", _msg)
end

test "message:created broadcasts to notification:lobby", %{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks like this test is failing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed.

Deprecate "shout" event for conversation channel
in favor of "message:created".
osbre added a commit to osbre/papercups that referenced this pull request Feb 25, 2026
Deprecate "shout" event for conversation and notification channels
in favor of "message:created". The old event still works but logs
a deprecation warning.

Adapted from papercups-io#488 with conflict resolution
to preserve file_ids, mentioned_user_ids, private message handling,
and other features added since the original PR.

Co-Authored-By: Ondrej Prazak <o.prazak5@seznam.cz>
osbre added a commit to osbre/papercups that referenced this pull request Feb 25, 2026
Deprecate "shout" event for conversation and notification channels
in favor of "message:created". The old event still works but logs
a deprecation warning.

Adapted from papercups-io#488 with conflict resolution
to preserve file_ids, mentioned_user_ids, private message handling,
and other features added since the original PR.

Co-Authored-By: Ondrej Prazak <o.prazak5@seznam.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants