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

[Bug] Stream模式下,可能丢失翻译结果末尾 #1032

Open
3 tasks done
XiaZixun opened this issue Dec 4, 2024 · 0 comments
Open
3 tasks done

[Bug] Stream模式下,可能丢失翻译结果末尾 #1032

XiaZixun opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@XiaZixun
Copy link

XiaZixun commented Dec 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Have you checked the FAQ (#6)?

  • I have checked the FAQ

Are you using the latest Zotero and the latest plugin?

  • I have confirmed I'm using the latest Zotero and the latest plugin

Environment

  • OS: macOS 15.1.1
  • Zotero Version: 7.0.10
  • Plugin Version: 2.0.12

Describe the bug

目前,我在使用openrouter所提供的API调用翻译。
当使用anthropic/claude-3.5-sonnet时,若启用steam模式,则可能丢失翻译末尾的少量字符。
但是,当取消stream,或使用openai/gpt-4o模型时,返回结果正常。
image

Debug Output

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "TypeError: _0x4a6c24 is null" {file: "jar:file:///Users/datasailor/Library/Application%20Support/Zotero/Profiles/a5fjnv9i.default/extensions/[email protected]!/chrome/content/scripts/zoterogpt.js" line: 1}]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "uncaught exception: undefined"]

[JavaScript Error: "TypeError: searchInput is undefined" {file: "jar:file:///Users/datasailor/Library/Application%20Support/Zotero/Profiles/a5fjnv9i.default/extensions/[email protected]!/chrome/content/scripts/zoteroaddons.js" line: 3728}]

[JavaScript Error: "TypeError: this[_0x4f4582(...)] is undefined" {file: "jar:file:///Users/datasailor/Library/Application%20Support/Zotero/Profiles/a5fjnv9i.default/extensions/[email protected]!/chrome/content/scripts/zoterostyle.js" line: 1}]

[JavaScript Error: "Upload request 1/2IFQTJK6 failed"]

[JavaScript Error: "You have reached your Zotero File Storage quota. Some files were not uploaded. Other Zotero data will continue to sync to the server.

See your zotero.org account settings for additional storage options.

2211.html (61 KB)"]

[JavaScript Error: "Upload request 1/36DHV99C failed"]

[JavaScript Error: "You have reached your Zotero File Storage quota. Some files were not uploaded. Other Zotero data will continue to sync to the server.

See your zotero.org account settings for additional storage options.

2306.html (62 KB)"]

appName => Zotero, version => 7.0.10 (ARM64), os => macOS 15.1.1, locale => en-US, extensions => Zoplicate (3.0.3, extension), Add-on Market for Zotero (1.7.2, extension), Actions and Tags for Zotero (2.0.5, extension), Awesome GPT (1.5.5, extension), Translate for Zotero (2.0.12, extension), Ethereal Reference (1.3.4, extension), Ethereal Style (5.3.2, extension), Better Notes for Zotero (2.1.7, extension)

(3)(+0023453): Notifier.trigger('start', 'sync', []) called [observers: 3]

(3)(+0000001): [Zoplicate] notify start sync [] undefined

(3)(+0000001): [ConcurrentCaller] Running function (0/4 running, 0 queued)

(3)(+0000000): HTTP GET https://api.zotero.org/keys/current

(3)(+0000384): HTTP GET https://api.zotero.org/keys/current succeeded with 200

(3)(+0000001): [ConcurrentCaller] Done with function (0/4 running, 0 queued)

(3)(+0000001): { "userID": 15513882 "username": "DataSailor" "displayName": "" "access": { "user": { "library": true "files": true "notes": true "write": true } "groups": { "all": { "library": true "write": true } } } }

(4)(+0000001): Beginning DB transaction xNd4b93h

(3)(+0000000): [ConcurrentCaller] All tasks are done

(4)(+0000001): Committed DB transaction xNd4b93h

(3)(+0000001): [ConcurrentCaller] Running function (0/4 running, 0 queued)

(3)(+0000001): HTTP GET https://api.zotero.org/users/15513882/groups?format=versions

(3)(+0000350): HTTP GET https://api.zotero.org/users/15513882/groups?format=versions succeeded with 200

(3)(+0000002): [ConcurrentCaller] Done with function (0/4 running, 0 queued)

(3)(+0000000): Local groups:

(3)(+0000000): []

(3)(+0000001): Final libraries to sync:

(3)(+0000000): [ "0": 1 ]

(3)(+0000000): Starting data sync for My Library

(4)(+0000001): SELECT setting, value FROM syncedSettings WHERE synced=0 AND libraryID=? [1]

(3)(+0000000): [ConcurrentCaller] All tasks are done

(3)(+0000001): No settings to upload in My Library

(4)(+0000000): SELECT O.collectionID FROM collections O WHERE libraryID=? AND synced=0 [1]

(4)(+0000001): SELECT key FROM syncQueue WHERE libraryID=? AND syncObjectTypeID IN (SELECT syncObjectTypeID FROM syncObjectTypes WHERE name=?) [1, 'collection']

(3)(+0000000): No collections to upload in My Library

(4)(+0000000): SELECT key FROM syncDeleteLog WHERE libraryID=? AND syncObjectTypeID=? [1, 1]

(3)(+0000000): No collection deletions to upload in My Library

(4)(+0000000): SELECT O.savedSearchID FROM savedSearches O WHERE libraryID=? AND synced=0 [1]

(4)(+0000001): SELECT key FROM syncQueue WHERE libraryID=? AND syncObjectTypeID IN (SELECT syncObjectTypeID FROM syncObjectTypes WHERE name=?) [1, 'search']

(3)(+0000000): No searches to upload in My Library

(4)(+0000000): SELECT key FROM syncDeleteLog WHERE libraryID=? AND syncObjectTypeID=? [1, 4]

(3)(+0000000): No search deletions to upload in My Library

(4)(+0000000): SELECT O.itemID FROM items O LEFT JOIN itemAttachments IA USING (itemID) LEFT JOIN itemNotes INo ON (O.itemID=INo.itemID) LEFT JOIN itemAnnotations IAn ON (O.itemID=IAn.itemID) WHERE libraryID=? AND synced=0 AND (IAn.isExternal IS NULL OR IAN.isExternal=0) [1]

(4)(+0000000): SELECT key FROM syncQueue WHERE libraryID=? AND syncObjectTypeID IN (SELECT syncObjectTypeID FROM syncObjectTypes WHERE name=?) [1, 'item']

(3)(+0000001): 1 item to upload in library 1

(4)(+0000000): SELECT key FROM syncDeleteLog WHERE libraryID=? AND syncObjectTypeID=? [1, 3]

(3)(+0000000): No item deletions to upload in My Library

(3)(+0000000): {"item":[1042]}

(4)(+0000000): Registering notifier observer 'itemsUpload_13' for [item]

(4)(+0000000): Beginning DB transaction NAh0HIKa

(4)(+0000001): SELECT data FROM syncCache WHERE libraryID=? AND key=? AND version=? AND syncObjectTypeID IN (SELECT syncObjectTypeID FROM syncObjectTypes WHERE name=?) [1, '9Q7LJNU3', 7047, 'item']

(4)(+0000001): Committed DB transaction NAh0HIKa

(3)(+0000000): UPLOAD BATCH:

(3)(+0000000): [ "0": { "key": "9Q7LJNU3" "version": 7047 "note": "TDPG57E2\n{"readingTime":{"page":19,"data":{"0":280}}}" "dateModified": "2024-12-04T08:49:27Z" } ]

(3)(+0000001): Uploading 1 item

(3)(+0000000): Sending If-Unmodified-Since-Version: 7047

(3)(+0000000): [ConcurrentCaller] Running function (0/4 running, 0 queued)

(3)(+0000000): HTTP POST "[{"key":"9Q7LJNU3","version":7047,"note":"TDPG57E2\n{"readingTime":{"page":19,"data":{"0":280}}}","dateModified":"2024-12-04T08:49:27Z"}]" to https://api.zotero.org/users/15513882/items

(3)(+0000509): HTTP POST https://api.zotero.org/users/15513882/items succeeded with 200

(3)(+0000001): [ConcurrentCaller] Done with function (0/4 running, 0 queued)

(4)(+0000003): Tags haven't changed

(4)(+0000000): Relations have not changed for item 1/9Q7LJNU3

(4)(+0000000): Field 'dateAdded' has not changed

(4)(+0000001): Field 'dateModified' has not changed

(4)(+0000000): Note hasn't changed

(3)(+0000000): Saving to sync cache:

(3)(+0000001): [ "0": { "key": "9Q7LJNU3" "version": 7048 "library": { "type": "user" "id": 15513882 "name": "DataSailor" "links": { "alternate": { "href": "https://www.zotero.org/datasailor" "type": "text/html" } } } "links": { "self": { "href": "https://api.zotero.org/users/15513882/items/9Q7LJNU3" "type": "application/json" } "alternate": { "href": "https://www.zotero.org/datasailor/items/9Q7LJNU3" "type": "text/html" } "up": { "href": "https://api.zotero.org/users/15513882/items/LEUISHEI" "type": "application/json" } } "meta": { "numChildren": 0 } "data": { "key": "9Q7LJNU3" "version": 7048 "parentItem": "LEUISHEI" "itemType": "note" "note": "TDPG57E2\n{"readingTime":{"page":19,"data":{"0":280}}}" "tags": [] "relations": {} "dateAdded": "2024-12-03T09:42:04Z" "dateModified": "2024-12-04T08:49:27Z" } } ]

(4)(+0000000): INSERT OR REPLACE INTO syncCache (libraryID, key, syncObjectTypeID, version, data) VALUES (?, ?, ?, ?, ?) [1, '9Q7LJNU3', 3, 7048, '{"key":"9Q7LJNU3","version":7048,"library":{"type":"user","id":15513882,"name":"DataSailor","links":{"alternate":{"href":"https://www.zotero.org/datasailor","type":"text/html"}}},"links":{"self":{"href":"https://api.zotero.org/users/15513882/items/9Q7LJNU3","type":"application/json"},"alternate":{"href":"https://www.zotero.org/datasailor/items/9Q7LJNU3","type":"text/html"},"up":{"href":"https://api.zotero.org/users/15513882/items/LEUISHEI","type":"application/json"}},"meta":{"numChildren":0},"data":{"key":"9Q7LJNU3","version":7048,"parentItem":"LEUISHEI","itemType":"note","note":"TDPG57E2\n{"readingTime":{"page":19,"data":{"0":280}}}","tags":[],"relations":{},"dateAdded":"2024-12-03T09:42:04Z","dateModified":"2024-12-04T08:49:27Z"}}']

(3)(+0000001): [ConcurrentCaller] All tasks are done

(4)(+0000001): Beginning DB transaction HQdAxYH5

(4)(+0000001): Item 1042 has not changed

(4)(+0000000): Updating database with new library data

(4)(+0000000): UPDATE libraries SET version=? WHERE libraryID=? [7048, 1]

(4)(+0000001): UPDATE items SET version=7048 WHERE itemID IN (?) [1042]

(4)(+0000000): UPDATE items SET synced=1 WHERE itemID IN (?) [1042]

(4)(+0000000): Committed DB transaction HQdAxYH5

(4)(+0000001): DELETE FROM syncCache WHERE ROWID IN (SELECT SC.ROWID FROM syncCache SC LEFT JOIN items O USING (libraryID, key, version) WHERE syncObjectTypeID=? AND SC.libraryID=? AND (O.libraryID IS NULL OR SC.version < O.version)) [3, 1]

(2)(+0000000): Failed: 0

(4)(+0000001): Unregistering notifier observer in notifier with id 'itemsUpload_13'

(3)(+0000000): Done uploading items in library 1

(3)(+0000000): {}

(4)(+0000000): Upload result is 1

(4)(+0000000): Updating database with new library data

(4)(+0000000): Beginning DB transaction leDqSngi

(4)(+0000000): UPDATE libraries SET lastSync=? WHERE libraryID=? [1733302171, 1]

(4)(+0000002): Committed DB transaction leDqSngi

(3)(+0000000): Done syncing My Library

(4)(+0000000): REPLACE INTO version (schema, version) VALUES ('lastsync', ?) [1733302171]

(3)(+0000001): Starting file syncing

(3)(+0000000): Done with file syncing

(3)(+0000000): Starting full-text syncing

(3)(+0000000): Done with full-text syncing

(3)(+0000000): Done syncing

(3)(+0000001): Notifier.trigger('finish', 'sync', []) called [observers: 3]

(4)(+0000000): SELECT libraryID AS id FROM feeds WHERE refreshInterval IS NOT NULL AND ( lastCheck IS NULL OR (julianday(lastCheck, 'utc') + (refreshInterval/1440.0) - julianday('now', 'utc')) <= 0 )

(3)(+0000000): Running update for feeds:

(3)(+0000000): All feed updates done

(3)(+0000000): Scheduling next feed update

(4)(+0000000): SELECT ( CASE WHEN lastCheck IS NULL THEN 0 ELSE strftime('%s', lastCheck) + refreshInterval * 60 - strftime('%s', 'now') END ) AS nextCheck FROM feeds WHERE refreshInterval IS NOT NULL ORDER BY nextCheck ASC LIMIT 1

(3)(+0000000): [Zoplicate] notify finish sync [] undefined

(3)(+0000000): No feeds with auto-update

(3)(+0005359): Starting full-text content processor

(4)(+0000001): Registering notifier observer 'fulltext_7V' for [sync]

Anything else?

No response

@XiaZixun XiaZixun added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants