From 4974208a65c5ced58ffbc8400ac47d680bd86dfc Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 20 Jan 2024 08:36:06 +0100 Subject: [PATCH 1/5] update arduinoJson 7.02 --- lib/ArduinoJson/CHANGELOG.md | 5 ++++ lib/ArduinoJson/CMakeLists.txt | 25 +++++++++++++++++++ lib/ArduinoJson/idf_component.yml | 13 ++++++++++ lib/ArduinoJson/library.json | 23 +++++++++++++++++ lib/ArduinoJson/library.properties | 11 ++++++++ .../src/ArduinoJson/Document/JsonDocument.hpp | 2 +- .../ArduinoJson/Memory/VariantPoolList.hpp | 1 + lib/ArduinoJson/src/ArduinoJson/version.hpp | 6 ++--- 8 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 lib/ArduinoJson/CMakeLists.txt create mode 100644 lib/ArduinoJson/idf_component.yml create mode 100644 lib/ArduinoJson/library.json create mode 100644 lib/ArduinoJson/library.properties diff --git a/lib/ArduinoJson/CHANGELOG.md b/lib/ArduinoJson/CHANGELOG.md index 498a8853b..e82281e20 100644 --- a/lib/ArduinoJson/CHANGELOG.md +++ b/lib/ArduinoJson/CHANGELOG.md @@ -1,6 +1,11 @@ ArduinoJson: change log ======================= +v7.0.2 (2024-01-19) +------ + +* Fix assertion `poolIndex < count_` after `JsonDocument::clear()` (issue #2034) + v7.0.1 (2024-01-10) ------ diff --git a/lib/ArduinoJson/CMakeLists.txt b/lib/ArduinoJson/CMakeLists.txt new file mode 100644 index 000000000..6efa04b3b --- /dev/null +++ b/lib/ArduinoJson/CMakeLists.txt @@ -0,0 +1,25 @@ +# ArduinoJson - https://arduinojson.org +# Copyright © 2014-2024, Benoit BLANCHON +# MIT License + +cmake_minimum_required(VERSION 3.15) + +if(ESP_PLATFORM) + # Build ArduinoJson as an ESP-IDF component + idf_component_register(INCLUDE_DIRS src) + return() +endif() + +project(ArduinoJson VERSION 7.0.2) + +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + include(CTest) +endif() + +add_subdirectory(src) + +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) + include(extras/CompileOptions.cmake) + add_subdirectory(extras/tests) + add_subdirectory(extras/fuzzing) +endif() diff --git a/lib/ArduinoJson/idf_component.yml b/lib/ArduinoJson/idf_component.yml new file mode 100644 index 000000000..429d37339 --- /dev/null +++ b/lib/ArduinoJson/idf_component.yml @@ -0,0 +1,13 @@ +version: "7.0.2" +description: >- + A simple and efficient JSON library for embedded C++. + ⭐ 6444 stars on GitHub! + Supports serialization, deserialization, MessagePack, streams, filtering, and more. + Fully tested and documented. +url: https://arduinojson.org/ +files: + exclude: + - "**/.vs/**/*" + - ".devcontainer/**/*" + - "examples/**/*" + - "extras/**/*" diff --git a/lib/ArduinoJson/library.json b/lib/ArduinoJson/library.json new file mode 100644 index 000000000..46f156ac4 --- /dev/null +++ b/lib/ArduinoJson/library.json @@ -0,0 +1,23 @@ +{ + "name": "ArduinoJson", + "keywords": "json, rest, http, web", + "description": "A simple and efficient JSON library for embedded C++. ⭐ 6444 stars on GitHub! Supports serialization, deserialization, MessagePack, streams, filtering, and more. Fully tested and documented.", + "homepage": "https://arduinojson.org/?utm_source=meta&utm_medium=library.json", + "repository": { + "type": "git", + "url": "https://github.com/bblanchon/ArduinoJson.git" + }, + "version": "7.0.2", + "authors": { + "name": "Benoit Blanchon", + "url": "https://blog.benoitblanchon.fr" + }, + "export": { + "include": ["src", "examples", "LICENSE.txt", "ArduinoJson.h"] + }, + "frameworks": "*", + "platforms": "*", + "build": { + "libArchive": false + } +} diff --git a/lib/ArduinoJson/library.properties b/lib/ArduinoJson/library.properties new file mode 100644 index 000000000..e9d9c2c7d --- /dev/null +++ b/lib/ArduinoJson/library.properties @@ -0,0 +1,11 @@ +name=ArduinoJson +version=7.0.2 +author=Benoit Blanchon +maintainer=Benoit Blanchon +sentence=A simple and efficient JSON library for embedded C++. +paragraph=⭐ 6444 stars on GitHub! Supports serialization, deserialization, MessagePack, streams, filtering, and more. Fully tested and documented. +category=Data Processing +url=https://arduinojson.org/?utm_source=meta&utm_medium=library.properties +architectures=* +repository=https://github.com/bblanchon/ArduinoJson.git +license=MIT diff --git a/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp b/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp index bc4a226da..d2daf97ad 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp @@ -65,7 +65,7 @@ class JsonDocument : public detail::VariantOperators { } // Reduces the capacity of the memory pool to match the current usage. - // https://arduinojson.org/v7/api/JsonDocument/shrinktofit/ + // https://arduinojson.org/v7/api/jsondocument/shrinktofit/ void shrinkToFit() { resources_.shrinkToFit(); } diff --git a/lib/ArduinoJson/src/ArduinoJson/Memory/VariantPoolList.hpp b/lib/ArduinoJson/src/ArduinoJson/Memory/VariantPoolList.hpp index 49a05d3b8..8ee5cef68 100644 --- a/lib/ArduinoJson/src/ArduinoJson/Memory/VariantPoolList.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/Memory/VariantPoolList.hpp @@ -103,6 +103,7 @@ class VariantPoolList { for (PoolCount i = 0; i < count_; i++) pools_[i].destroy(allocator); count_ = 0; + freeList_ = NULL_SLOT; if (pools_ != preallocatedPools_) { allocator->deallocate(pools_); pools_ = preallocatedPools_; diff --git a/lib/ArduinoJson/src/ArduinoJson/version.hpp b/lib/ArduinoJson/src/ArduinoJson/version.hpp index f96ced9c6..e41890e9f 100644 --- a/lib/ArduinoJson/src/ArduinoJson/version.hpp +++ b/lib/ArduinoJson/src/ArduinoJson/version.hpp @@ -4,8 +4,8 @@ #pragma once -#define ARDUINOJSON_VERSION "7.0.1" +#define ARDUINOJSON_VERSION "7.0.2" #define ARDUINOJSON_VERSION_MAJOR 7 #define ARDUINOJSON_VERSION_MINOR 0 -#define ARDUINOJSON_VERSION_REVISION 1 -#define ARDUINOJSON_VERSION_MACRO V701 +#define ARDUINOJSON_VERSION_REVISION 2 +#define ARDUINOJSON_VERSION_MACRO V702 From d5cb5c1c5140d3ecb77091419deb107e5f2b9e81 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 20 Jan 2024 10:45:01 +0100 Subject: [PATCH 2/5] update packages --- interface/package.json | 8 +++---- interface/yarn.lock | 54 +++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/interface/package.json b/interface/package.json index c5b544f63..d3908e499 100644 --- a/interface/package.json +++ b/interface/package.json @@ -24,7 +24,7 @@ "@babel/core": "^7.23.7", "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", - "@mui/icons-material": "^5.15.4", + "@mui/icons-material": "^5.15.5", "@mui/material": "^5.15.5", "@table-library/react-table-library": "4.1.7", "@types/imagemin": "^8.0.5", @@ -43,7 +43,7 @@ "react-dom": "latest", "react-dropzone": "^14.2.3", "react-icons": "^5.0.1", - "react-router-dom": "^6.21.2", + "react-router-dom": "^6.21.3", "react-toastify": "^10.0.3", "sockette": "^2.0.6", "typesafe-i18n": "^5.26.2", @@ -69,8 +69,8 @@ "preact": "^10.19.3", "prettier": "^3.2.4", "rollup-plugin-visualizer": "^5.12.0", - "terser": "^5.26.0", - "vite": "^5.0.11", + "terser": "^5.27.0", + "vite": "^5.0.12", "vite-plugin-imagemin": "^0.6.1", "vite-tsconfig-paths": "^4.3.1" }, diff --git a/interface/yarn.lock b/interface/yarn.lock index b56b05902..95918a750 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -401,7 +401,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.23.7, @babel/runtime@npm:^7.23.8": +"@babel/runtime@npm:^7.23.8": version: 7.23.8 resolution: "@babel/runtime@npm:7.23.8" dependencies: @@ -999,11 +999,11 @@ __metadata: languageName: node linkType: hard -"@mui/icons-material@npm:^5.15.4": - version: 5.15.4 - resolution: "@mui/icons-material@npm:5.15.4" +"@mui/icons-material@npm:^5.15.5": + version: 5.15.5 + resolution: "@mui/icons-material@npm:5.15.5" dependencies: - "@babel/runtime": "npm:^7.23.7" + "@babel/runtime": "npm:^7.23.8" peerDependencies: "@mui/material": ^5.0.0 "@types/react": ^17.0.0 || ^18.0.0 @@ -1011,7 +1011,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 1c9be5d3e23a6b565a36d36065e8a2480feebfb497ea7367f7fd32f90164e46420e5be8117fcfd05f2a3c1940b8fa48f56caccc19da78849fc8bda037f186954 + checksum: 25feb86a76ce83c81391c95d0c1c867e988cc7bc1b5a05c5698b71cb3cd1005fd148b07c2fa8908cda9fc4e44ea8b6e0fd2197bc0abafac0ee4880b477852eea languageName: node linkType: hard @@ -1829,7 +1829,7 @@ __metadata: "@babel/core": "npm:^7.23.7" "@emotion/react": "npm:^11.11.3" "@emotion/styled": "npm:^11.11.0" - "@mui/icons-material": "npm:^5.15.4" + "@mui/icons-material": "npm:^5.15.5" "@mui/material": "npm:^5.15.5" "@preact/compat": "npm:^17.1.2" "@preact/preset-vite": "npm:^2.8.1" @@ -1866,14 +1866,14 @@ __metadata: react-dom: "npm:latest" react-dropzone: "npm:^14.2.3" react-icons: "npm:^5.0.1" - react-router-dom: "npm:^6.21.2" + react-router-dom: "npm:^6.21.3" react-toastify: "npm:^10.0.3" rollup-plugin-visualizer: "npm:^5.12.0" sockette: "npm:^2.0.6" - terser: "npm:^5.26.0" + terser: "npm:^5.27.0" typesafe-i18n: "npm:^5.26.2" typescript: "npm:^5.3.3" - vite: "npm:^5.0.11" + vite: "npm:^5.0.12" vite-plugin-imagemin: "npm:^0.6.1" vite-tsconfig-paths: "npm:^4.3.1" languageName: unknown @@ -7218,27 +7218,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.21.2": - version: 6.21.2 - resolution: "react-router-dom@npm:6.21.2" +"react-router-dom@npm:^6.21.3": + version: 6.21.3 + resolution: "react-router-dom@npm:6.21.3" dependencies: "@remix-run/router": "npm:1.14.2" - react-router: "npm:6.21.2" + react-router: "npm:6.21.3" peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: 24d1470e68f11369776c623b8873c8cf0af476d102317cb3aa6b13b48c86908f10a6e51209ce24dccf40e429538d4e23fda796c190f2ff98f894cb476d51f44d + checksum: 6e23e35d02e5c83847c8e47d7912d1f6c2c42a35f2317802031bdd993a8205468138a045ff34f67fe807fe9f7dc9d0995ee05bab25aedc0bf978e620ac132815 languageName: node linkType: hard -"react-router@npm:6.21.2": - version: 6.21.2 - resolution: "react-router@npm:6.21.2" +"react-router@npm:6.21.3": + version: 6.21.3 + resolution: "react-router@npm:6.21.3" dependencies: "@remix-run/router": "npm:1.14.2" peerDependencies: react: ">=16.8" - checksum: 08701bfe9e7b860442dd0f3c6e36d3ea6106d86db5ec9da930fd56d5782a13b82612826de7dd31bb38832f3fa76437d7a0ca36e63a76256f62d5b738f529a48c + checksum: 3d5107cfdb440519d84e6ad6d95454e3bf41ec97677b95f7b2a7f281f8ddf191b765cf1b599ead951f3cd33ed4429f140590d74a01cfdf835dc2f812023a978a languageName: node linkType: hard @@ -8338,9 +8338,9 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.26.0": - version: 5.26.0 - resolution: "terser@npm:5.26.0" +"terser@npm:^5.27.0": + version: 5.27.0 + resolution: "terser@npm:5.27.0" dependencies: "@jridgewell/source-map": "npm:^0.3.3" acorn: "npm:^8.8.2" @@ -8348,7 +8348,7 @@ __metadata: source-map-support: "npm:~0.5.20" bin: terser: bin/terser - checksum: 0282c5c065cbfa1e725d5609b99579252bc20b83cd1d75e8ab8b46d5da2c9d0fcfc453a12624f2d2d4c1240bfa0017a90fcf1e3b88258e5842fca1b0b82be8d8 + checksum: 9b2c5cb00747dea5994034ca064fb3cc7efc1be6b79a35247662d51ab43bdbe9cbf002bbf29170b5f3bd068c811d0212e22d94acd2cf0d8562687b96f1bffc9f languageName: node linkType: hard @@ -8764,9 +8764,9 @@ __metadata: languageName: node linkType: hard -"vite@npm:^5.0.11": - version: 5.0.11 - resolution: "vite@npm:5.0.11" +"vite@npm:^5.0.12": + version: 5.0.12 + resolution: "vite@npm:5.0.12" dependencies: esbuild: "npm:^0.19.3" fsevents: "npm:~2.3.3" @@ -8800,7 +8800,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: f1a8fea35ed9f162d7a10fd13efb2c96637028b0a319d726aeec8b31e20e4d047272bda5df82167618e7774a520236c66f3093ed172802660aec5227814072f4 + checksum: ed0bb26a0d0c8e1dae0b70af9e36adffd7e15d80297443fe4da762596dc81570bad7f0291f590a57c1553f5e435338d8c7ffc483bd9431a95c09d9ac90665fad languageName: node linkType: hard From 65ff765219eac635583b255084c52c32a865fd24 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 20 Jan 2024 10:45:52 +0100 Subject: [PATCH 3/5] workaround for #1564 --- interface/src/components/upload/SingleUpload.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/interface/src/components/upload/SingleUpload.tsx b/interface/src/components/upload/SingleUpload.tsx index 498e4b913..bbd3e9ce3 100644 --- a/interface/src/components/upload/SingleUpload.tsx +++ b/interface/src/components/upload/SingleUpload.tsx @@ -50,8 +50,10 @@ const SingleUpload: FC = ({ onDrop, onCancel, isUploading, pr const progressText = () => { if (uploading) { - if (progress.total) { - return LL.UPLOADING() + ': ' + Math.round((progress.loaded * 100) / progress.total) + '%'; + if (progress.total && progress.loaded) { + return progress.loaded <= progress.total + ? LL.UPLOADING() + ': ' + Math.round((progress.loaded * 100) / progress.total) + '%' + : LL.UPLOADING() + ': ' + Math.round((progress.total * 100) / progress.loaded) + '%'; } } return LL.UPLOAD_DROP_TEXT(); @@ -83,7 +85,13 @@ const SingleUpload: FC = ({ onDrop, onCancel, isUploading, pr