-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WS sendImmediately #1949
Fix WS sendImmediately #1949
Conversation
Looks good, can you explain in more detail on the description what's bugged about the current behavior? |
Issue #1930 : when no sending element is provided to |
@@ -749,6 +749,24 @@ describe("web-sockets extension", function () { | |||
window.document.removeEventListener("htmx:wsOpen", handler) | |||
} | |||
}) | |||
it('sends message if no sending element is provided', function (done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexpetros This test is the one which would currently fail; no sending element would result in the message being gobbled up.
Added your comment to the description, hope that's alright. Just making it easier for 1cg to review. |
@Renerick can you review, looks like a great change but I want you to see it as well before I merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was an unfortunate oversight on my part, haha. The fix looks good and tests are excellent. LGTM
Description
Fixes #1930.
When no sending element is provided to sendImmediately, the message is not sent to the socket, which contradicts the documentation which states that sendingElt is optional.
This PR:
beforeSend
andafterSend
on the correct element if providedTo the reviewers, I've noticed that no second level "describe" is used to group the tests. In order to better focus on my own tests, it was easier for me to have a sub section of tests under ws extension. I've left it as is but please let me know if that's an issue.