一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
25 行
951 B
Diff
25 行
951 B
Diff
# Resolves an issue in which notes and attachments larger than 16 KB
|
|
# could become corrupted during the upload process.
|
|
# See https://github.com/laurent22/joplin/issues/14343
|
|
diff --git a/src/parsers/JSON.js b/src/parsers/JSON.js
|
|
index 9a096c25778c7c68be1ddd9dd78faa85bd1d8ec3..6d6bfd2d3789313a7adc8966ab8e58c3d3167356 100644
|
|
--- a/src/parsers/JSON.js
|
|
+++ b/src/parsers/JSON.js
|
|
@@ -12,13 +12,14 @@ class JSONParser extends Transform {
|
|
}
|
|
|
|
_transform(chunk, encoding, callback) {
|
|
- this.chunks.push(String(chunk)); // todo consider using a string decoder
|
|
+ this.chunks.push(chunk); // type: Uint8Array
|
|
callback();
|
|
}
|
|
|
|
_flush(callback) {
|
|
try {
|
|
- const fields = JSON.parse(this.chunks.join(''));
|
|
+ const data = Buffer.concat(this.chunks);
|
|
+ const fields = JSON.parse(data.toString('utf-8'));
|
|
Object.keys(fields).forEach((key) => {
|
|
const value = fields[key];
|
|
this.push({ key, value });
|