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

Fix plotting of measurements with long comments #999

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ All notable changes to this project will be documented in this file. The format

- Dropped support for Node.js 18 and below.

### Fixed

- Fixed plotting of measurements with very long comments.

### Security

- Updated dependencies.
Expand Down
6 changes: 5 additions & 1 deletion functions/kpi/progress/handleKpiProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export default async function updateKpiProgress(change, { params }) {
progressCollection.map((p) => [
p.timestamp.toDate().toISOString().slice(0, 10),
parseFloat(p.value.toFixed(4)),
p.comment || '',
/*
* Crop the comment to avoid bloating the cache as Firestore has a limit
* of 1 MB per document.
*/
p.comment ? p.comment.substring(0, 500) : '',
])
);

Expand Down
Loading