parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

feat: add client socket ID to LiveQuery `ws_disconnect`, `ws_connect` , `connect` and `subscribe` event

Open krtooch opened this issue 3 years ago • 6 comments
trafficstars

New Pull Request Checklist

  • [x] I am not disclosing a vulnerability.
  • [x] I am creating this PR in reference to an issue.

Issue Description

In order to create a Online/offline functionality with ParseLiveQuery socket protocol, i'd like to add client's socket Id to 'ws_disconnect' event, in order to know which socket is disconnecting.

Approach

Just add existing client ID, to ws_disconnect Object.

TODOs before merging

  • [x] Add changes to documentation (guides, repository pages, in-code descriptions)
  • [x] A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

This is my first ever contribution on Github, so sorry if not totally well done.

krtooch avatar May 12 '22 15:05 krtooch

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Related issue: #123 in the PR description, so I can recognize it.

Codecov Report

Merging #7999 (20445b8) into alpha (b10182f) will increase coverage by 0.00%. The diff coverage is n/a.

:exclamation: Current head 20445b8 differs from pull request most recent head deeff1f. Consider uploading reports for the commit deeff1f to get more accurate results

@@           Coverage Diff           @@
##            alpha    #7999   +/-   ##
=======================================
  Coverage   94.11%   94.11%           
=======================================
  Files         182      182           
  Lines       13621    13621           
=======================================
+ Hits        12819    12820    +1     
+ Misses        802      801    -1     
Impacted Files Coverage Δ
src/LiveQuery/ParseLiveQueryServer.js 95.48% <ø> (ø)
src/RestWrite.js 94.46% <0.00%> (+0.15%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b10182f...deeff1f. Read the comment docs.

codecov[bot] avatar May 12 '22 16:05 codecov[bot]

@krtooch thanks for the PR, let us know when this is ready for review.

mtrezza avatar May 12 '22 22:05 mtrezza

ok for review.

krtooch avatar May 13 '22 12:05 krtooch

Hello i added clientId, to ws_connect , connect and subscribe, and add some test to check req.

krtooch avatar May 16 '22 13:05 krtooch

@krtooch Could you address any open review comments, so we can merge this?

mtrezza avatar May 30 '22 09:05 mtrezza