feat(state): add deleteBulk method for batch state deletion#807
Open
madmecodes wants to merge 3 commits intodapr:mainfrom
Open
feat(state): add deleteBulk method for batch state deletion#807madmecodes wants to merge 3 commits intodapr:mainfrom
madmecodes wants to merge 3 commits intodapr:mainfrom
Conversation
Contributor
|
@madmecodes First of all, thank you for taking the time to contribute something to this repository. Could you please make sure to sign your commits? I'm unable to accept any PRs that are not signed. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #807 +/- ##
============================================
- Coverage 100.00% 25.84% -74.16%
============================================
Files 1 138 +137
Lines 6 3742 +3736
Branches 1 568 +567
============================================
+ Hits 6 967 +961
- Misses 0 2731 +2731
- Partials 0 44 +44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: madmecodes <ayushguptadev1@gmail.com>
46cc311 to
862e40c
Compare
Comment on lines
+131
to
+133
| try { | ||
| await Promise.all( | ||
| items.map((item) => |
Comment on lines
+134
to
+138
| this.delete(storeName, item.key, { | ||
| etag: item.etag, | ||
| concurrency: item.options?.concurrency, | ||
| consistency: item.options?.consistency, | ||
| }), |
Comment on lines
+135
to
+148
| async deleteBulk( | ||
| storeName: string, | ||
| items: KeyValuePairType[], | ||
| _options: StateDeleteBulkOptions = {}, | ||
| ): Promise<StateSaveResponseType> { | ||
| const states: StateItem[] = []; | ||
|
|
||
| for (const item of items) { | ||
| const si = create(StateItemSchema, { | ||
| key: item.key, | ||
| etag: item?.etag ? create(EtagSchema, { value: item.etag }) : undefined, | ||
| options: this._configureStateOptions(item?.options), | ||
| metadata: item.metadata ?? {}, | ||
| }); |
Comment on lines
+32
to
+36
| deleteBulk( | ||
| storeName: string, | ||
| items: KeyValuePairType[], | ||
| options?: StateDeleteBulkOptions, | ||
| ): Promise<StateSaveResponseType>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deleteBulktoIClientStateinterface acceptingKeyValuePairType[]with per-item etag/metadata/optionsDeleteBulkStateRPC directly usingDeleteBulkStateRequestSchemaStateDeleteBulkOptionstype from the packageFixes #785
Test plan
test/e2e/common/client.test.tsnpx tsc --noEmitpasses with no new errors)