Skip to content

Commit cce95ed

Browse files
dzackgarzaGPT-5
andcommitted
fix: release v3.2.3 for blob-backed attach fallback
Why: The 3.2.2 add-on still crashes the forwarded Zotero server during the bytes fallback for `/attach`. Zotero's own `file.js` implementation accepts Blob at runtime and converts it to an input stream, while our code was still passing a raw ArrayBuffer through a type path that does not actually work. Changes: - Write the decoded attachment bytes as a Blob when materializing a temp file for the attach fallback. - Keep the change narrowly scoped with a type-level cast that documents the mismatch between the runtime API and zotero-types. - Bump the release metadata to 3.2.3 and regenerate `updates.json` for the new GitHub release asset. Decisions: - Chose Blob over ArrayBuffer because it matches Zotero's own `putContentsAsync()` runtime path and avoids another speculative workaround. - Released another patch version because this is a corrective runtime fix for the existing attach fallback behavior. Expected outcome: After updating to v3.2.3, the bytes fallback should stop resetting the Zotero server and allow live `upload_pdf` proofs to complete. Co-Authored-By: GPT-5 <noreply@google.com>
1 parent 7ee6c88 commit cce95ed

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.2
1+
3.2.3

src/bootstrap.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ async function materializeUploadBytes(fileName: string, fileBytesBase64: string)
205205
for (let index = 0; index < binary.length; index++) {
206206
bytes[index] = binary.charCodeAt(index);
207207
}
208-
await Zotero.File.putContentsAsync(tempDir.path, bytes.buffer);
208+
// Zotero.File.putContentsAsync() accepts Blob at runtime, but zotero-types
209+
// only advertises string | ArrayBuffer | nsIInputStream.
210+
await Zotero.File.putContentsAsync(tempDir.path, new Blob([bytes]) as unknown as ArrayBuffer);
209211
return tempDir.path;
210212
}
211213

updates.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"strict_min_version": "7.0"
1010
}
1111
},
12-
"update_hash": "sha256:7c21015dd751c55d791d236c487600fe99f59110b6eb518f9564814dbd1acd5b",
13-
"update_link": "https://github.com/dzackgarza/zotero-local-write-api/releases/download/v3.2.2/local-write-api-3.2.2.xpi",
14-
"version": "3.2.2"
12+
"update_hash": "sha256:6c1f9f8c9e5e7e19483b325b3fcd31be2932525ea28ca19cf532878178393b68",
13+
"update_link": "https://github.com/dzackgarza/zotero-local-write-api/releases/download/v3.2.3/local-write-api-3.2.3.xpi",
14+
"version": "3.2.3"
1515
}
1616
]
1717
}

0 commit comments

Comments
 (0)