dapr / js-sdk

Dapr SDK for Javascript
Apache License 2.0
194 stars 82 forks source link

feat(pubsub): add wildcard support (+, #) #529

Closed shubham1172 closed 11 months ago

shubham1172 commented 11 months ago

Description

This PR moves the shared pubsub logic b/w HTTP and gRPC into a common module. It also introduces a wildcard matching function to allow receiving events correctly.

TODO

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

codecov[bot] commented 11 months ago

Codecov Report

Attention: 30 lines in your changes are missing coverage. Please review.

Comparison is base (7464735) 35.34% compared to head (d7f5eb7) 35.28%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #529 +/- ## ========================================== - Coverage 35.34% 35.28% -0.07% ========================================== Files 90 91 +1 Lines 10187 10170 -17 Branches 429 408 -21 ========================================== - Hits 3601 3588 -13 - Misses 6516 6523 +7 + Partials 70 59 -11 ``` | [Files](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr) | Coverage Δ | | |---|---|---| | [...mplementation/Client/GRPCClient/GRPCClientProxy.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL0NsaWVudC9HUlBDQ2xpZW50L0dSUENDbGllbnRQcm94eS50cw==) | `15.00% <ø> (ø)` | | | [src/implementation/Server/GRPCServer/pubsub.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL1NlcnZlci9HUlBDU2VydmVyL3B1YnN1Yi50cw==) | `79.31% <100.00%> (ø)` | | | [src/implementation/Server/HTTPServer/HTTPServer.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL1NlcnZlci9IVFRQU2VydmVyL0hUVFBTZXJ2ZXIudHM=) | `76.74% <100.00%> (ø)` | | | [...implementation/Server/HTTPServer/HTTPServerImpl.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL1NlcnZlci9IVFRQU2VydmVyL0hUVFBTZXJ2ZXJJbXBsLnRz) | `89.61% <100.00%> (+3.78%)` | :arrow_up: | | [src/implementation/Server/HTTPServer/pubsub.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL1NlcnZlci9IVFRQU2VydmVyL3B1YnN1Yi50cw==) | `79.31% <100.00%> (ø)` | | | [src/utils/Settings.util.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL3V0aWxzL1NldHRpbmdzLnV0aWwudHM=) | `73.68% <100.00%> (+3.09%)` | :arrow_up: | | [...implementation/Server/GRPCServer/GRPCServerImpl.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL2ltcGxlbWVudGF0aW9uL1NlcnZlci9HUlBDU2VydmVyL0dSUENTZXJ2ZXJJbXBsLnRz) | `59.34% <58.33%> (-6.60%)` | :arrow_down: | | [src/pubsub/subscriptionManager.ts](https://app.codecov.io/gh/dapr/js-sdk/pull/529?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr#diff-c3JjL3B1YnN1Yi9zdWJzY3JpcHRpb25NYW5hZ2VyLnRz) | `80.26% <80.26%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/dapr/js-sdk/pull/529/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dapr)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.