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

Historize asset for each same measurements #290

Merged
merged 15 commits into from
Apr 17, 2023

Conversation

tdislay
Copy link
Contributor

@tdislay tdislay commented Mar 30, 2023

What does this PR do ?

This PR fix an issue when multiple same measurements sent over one payload were ingested, only the most recent measure would be historized.
Also, it adds a timestamp property to assetHistoryContent. It allows you to sort documents by event emitted date rather that document created_at.

I also used a mCreate in the asset history add event instead of a simple create

@tdislay tdislay added the bug Something isn't working label Mar 30, 2023
@tdislay tdislay self-assigned this Mar 30, 2023
@github-advanced-security
Copy link

You have successfully added a new CodeQL configuration /language:javascript. As part of the setup process, we have scanned this repository and found 119 existing alerts. Please check the repository Security tab to see all alerts.

lib/modules/measure/MeasureService.ts Outdated Show resolved Hide resolved
lib/modules/measure/MeasureService.ts Outdated Show resolved Hide resolved
@Aschen Aschen added changelog:bug-fixes and removed bug Something isn't working labels Mar 31, 2023
@tdislay tdislay force-pushed the fix/historize-asset-multiple-times branch from 3b5b7d0 to e451fa0 Compare April 11, 2023 08:21
@tdislay tdislay requested review from fmauNeko and Aschen April 11, 2023 08:29
@tdislay tdislay requested a review from Aschen April 11, 2023 15:53
tests/scenario/modules/assets/asset-history.test.ts Outdated Show resolved Hide resolved
tests/scenario/modules/assets/asset-history.test.ts Outdated Show resolved Hide resolved
tests/scenario/modules/assets/asset-history.test.ts Outdated Show resolved Hide resolved
tests/scenario/modules/assets/asset-history.test.ts Outdated Show resolved Hide resolved
@tdislay tdislay force-pushed the fix/historize-asset-multiple-times branch from 2b9222f to 3483d6f Compare April 13, 2023 15:26
lib/modules/measure/MeasureService.ts Outdated Show resolved Hide resolved
lib/modules/asset/AssetHistoryService.ts Outdated Show resolved Hide resolved
lib/modules/asset/AssetService.ts Outdated Show resolved Hide resolved
lib/modules/measure/MeasureService.ts Show resolved Hide resolved
Co-authored-by: Adrien Maret <Aschen@users.noreply.github.com>
Co-authored-by: Adrien Maret <Aschen@users.noreply.github.com>
@tdislay tdislay merged commit 8fff0b7 into 2-dev Apr 17, 2023
@Aschen Aschen mentioned this pull request Apr 17, 2023
Aschen added a commit that referenced this pull request Apr 17, 2023
# [2.2.0](https://github.com/kuzzleio/kuzzle-device-manager/releases/tag/2.2.0) (2023-04-17)


#### Bug fixes

- [ [#290](#290) ] Historize asset for each same measurements   ([tdislay](https://github.com/tdislay))
- [ [#288](#288) ] Full path nested metadata when create/update assets   ([OlivierCavadenti](https://github.com/OlivierCavadenti))
- [ [#286](#286) ] ModelService upsert -> createOrReplace   ([fmauNeko](https://github.com/fmauNeko))
- [ [#282](#282) ] Fix engine creation   ([Aschen](https://github.com/Aschen))

#### New features

- [ [#296](#296) ] Export measures to CSV   ([Aschen](https://github.com/Aschen))
- [ [#291](#291) ] Add type of measure linked in each links of asset measures.   ([OlivierCavadenti](https://github.com/OlivierCavadenti))

#### Enhancements

- [ [#295](#295) ] Export default mappings   ([Aschen](https://github.com/Aschen))
- [ [#293](#293) ] Allow JSONObject in metadata   ([Aschen](https://github.com/Aschen))
- [ [#287](#287) ] Update metadata in existing assets when the model is modified   ([fmauNeko](https://github.com/fmauNeko))
- [ [#283](#283) ] Store reason of discarded payloads   ([OlivierCavadenti](https://github.com/OlivierCavadenti))

#### Others

- [ [#289](#289) ] Split tsconfig for tests   ([fmauNeko](https://github.com/fmauNeko))
---
@tdislay tdislay deleted the fix/historize-asset-multiple-times branch May 9, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants