Public SavedObjectsClient.resolve fails when batching sometimes #113791
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Security/Sharing Saved Objects
Platform Security - Sharing Saved Objects feature
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
Team:Security
Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Kibana version: 7.16 (unreleased)
Describe the bug:
Starting in #112025, the public SavedObjectsClient (SOC) batches individual
resolve
requests into a singlebulkResolve
.We discovered a bug in #113160 where the batched resolve results would not be mapped correctly in the case of "aliasMatch" outcomes.
In fixing that bug, I introduced a new bug that caused batched
resolve
requests to sometimes return an undefined response, because the request array indices were not properly aligned with the response array 😱Steps to reproduce:
resolve
requests in quick succession:type/1
,type/1
,type/2
.bulkResolve
HTTP request will be made for[type/id, type/other-id]
Expected behavior: All requests should return the appropriate result
Any additional context:
Existing unit tests are in place and partially exercise deduplication.
As long as the duplicate request is at the end, it doesn't cause any problems.
E.g., three
resolve
requests like this works fine today:type/1
,type/2
,type/1
.So the fix should exercise this in tests:
type/1
,type/2
,type/1
,type/3
.That will ensure that requests are deduplicated in the batched
bulkResolve
, and that other requests both inside the array and at the end of the array still work as expected.The text was updated successfully, but these errors were encountered: