Skip to content
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

Public SavedObjectsClient.resolve fails when batching sometimes #113791

Closed
jportner opened this issue Oct 4, 2021 · 1 comment · Fixed by #113798
Closed

Public SavedObjectsClient.resolve fails when batching sometimes #113791

jportner opened this issue Oct 4, 2021 · 1 comment · Fixed by #113798
Assignees
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!

Comments

@jportner
Copy link
Contributor

jportner commented Oct 4, 2021

Kibana version: 7.16 (unreleased)

Describe the bug:

Starting in #112025, the public SavedObjectsClient (SOC) batches individual resolve requests into a single bulkResolve.
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:

  1. Add some code that triggers three resolve requests in quick succession: type/1, type/1, type/2.
  2. A single bulkResolve HTTP request will be made for [type/id, type/other-id]
  3. The first two requests will return as expected, but the third will return undefined

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.

@jportner jportner added bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Oct 4, 2021
@jportner jportner self-assigned this Oct 4, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@exalate-issue-sync exalate-issue-sync bot added 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 labels Oct 5, 2021
@jportner jportner added the Feature:Security/Sharing Saved Objects Platform Security - Sharing Saved Objects feature label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants