Skip to content

Commit

Permalink
[mod] [#437] Don't wrap client-side pings (evaluate)
Browse files Browse the repository at this point in the history
Requires further review.

This is a minor but potentially BREAKING change.
Zero urgency, consider holding till next breaking set.

Before this commit:

  Client-side `[:chsk/ws-ping]` events are wrapped to
  `[:chsk/recv [:chsk/ws-ping]]` when `wrap-recv-evs?` is true.

After this commit:

  Client-side `[:chsk/ws-ping` events are NOT wrapped, even
  when `wrap-recv-evs?` is true.

MOTIVATION:

  While `:chsk/ping` is indeed pushed from server, `:chsk/recv` is
  in practice reserved for user-level events. Keeping it that way
  may be better (more convenient for users).
  • Loading branch information
ptaoussanis committed Sep 5, 2023
1 parent f25e176 commit 50a93c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/taoensso/sente.cljc
Expand Up @@ -1517,8 +1517,8 @@
:done/did-handshake)

(when (= clj :chsk/ws-ping)
(-chsk-send! chsk [:chsk/ws-pong] {:flush? true})
(put! (:<server chs) [:chsk/ws-ping])
(-chsk-send! chsk [:chsk/ws-pong] {:flush? true})
(put! (:internal chs) [:chsk/ws-ping])
:done/sent-pong)

(if-let [cb-uuid ?cb-uuid]
Expand Down

0 comments on commit 50a93c8

Please sign in to comment.