-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fix generic events on search queries #1698
Conversation
Codecov Report
@@ Coverage Diff @@
## 2-dev #1698 +/- ##
==========================================
+ Coverage 93.52% 93.53% +0.01%
==========================================
Files 113 113
Lines 7197 7209 +12
==========================================
+ Hits 6731 6743 +12
Misses 466 466
Continue to review full report at Codecov.
|
return request; | ||
}, | ||
}, | ||
targets: ['search', 'deleteByQuery'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought updateByQuery
was not eligible either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateByQuery
is handled by the same extractor than mCreate
, mReplace
, etc. because they share the same format.
The blacklist is done in the documentEventAliases.js
file: /~https://github.com/kuzzleio/kuzzle/pull/1698/files#diff-cda9b5cb3d677fb4f72bd365d3318910
So the extractFromRequest
and insertInRequest
extractor methods cannot be invoked for updateByQuery
.
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
# [2.3.2](/~https://github.com/kuzzleio/kuzzle/releases/tag/2.3.2) (2020-07-07) #### Bug fixes - [ [#1701](#1701) ] Fix: description should not be required for plugin custom errors ([scottinet](/~https://github.com/scottinet)) - [ [#1695](#1695) ] Fix dump generation ([Aschen](/~https://github.com/Aschen)) - [ [#1698](#1698) ] Fix generic events on search queries ([scottinet](/~https://github.com/scottinet)) #### Enhancements - [ [#1702](#1702) ] Update search indexes only when the "dynamic" setting changes from false to true/strict ([Aschen](/~https://github.com/Aschen)) - [ [#1630](#1630) ] Loose coupling: security module ([scottinet](/~https://github.com/scottinet)) - [ [#1604](#1604) ] Add request ID in log ([Aschen](/~https://github.com/Aschen)) ---
Description
Generic events on the following API routes were handled by a default document extractor, providing incorrect results to plugin developers:
document:search
,document:deleteByQuery
,document:updateByQuery
Changes
default
document extractor. Instead, if Kuzzle is tasked to extract documents from an unknown request action, it throws anInternalError
with this new error code:core.fatal.assertion_failed
. This new error is meant to be used for runtime assertions, making sure that the code performs according to specifications. Here, adefault
document extractor is clearly not what we want, as it hides potential errors or omissions (and it did exactly that here)document:search
,document:deleteByQuery
,document:updateByQuery
document:updateByQuery
from "before" document events, as documents cannot be extracted from requests made to that API route