kuzzleio / kuzzle

Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -
https://kuzzle.io
Apache License 2.0
1.43k stars 123 forks source link

_kuzzle_info.updatedAt and .updater are still null after a mUpdate() operation #2532

Open psam44 opened 3 months ago

psam44 commented 3 months ago

The single update() operation is not affected because its code is different.

The bug is at /lib/service/storage/elasticsearch.ts#L3120, _processExtract():

    _source: Object.assign({}, metadata, document.body),

The metadata content is correct, but assign() states that "Later sources' properties overwrite earlier ones.", and document.body has already these properties, with null values. I got the expected behaviour with this hack in the distributed js:

            _source: Object.assign({}, document.body, metadata),

I didn't investigate on the two other assign() usages in this file, but they probably have a similar defect.

Context (Environment)

Kuzzle version: master Node.js version: SDK version:

rolljee commented 3 months ago

Thank you for reporting this issue, we will have a look into into it.

If you have the time to do it PRs are welcomed