The comparison above does not work if this.items[i] is an object, since the two can never be the exact same instances. Although Zotero seems to specify that items in the select handler should be strings, not objects, some translators (like PubMed.js) do not follow that specification.
As for a fix, I can make a PR that compares the serialized JSON of both items instead, which should be sufficient since one of the two has been serialized already.
This line compares selected items to the items from the original session:
https://github.com/zotero/translation-server/blob/2dfd9dcb19ab45323a23eb88277a64c48e99ecd4/src/webSession.js#L349
The comparison above does not work if
this.items[i]
is an object, since the two can never be the exact same instances. Although Zotero seems to specify that items in theselect
handler should be strings, not objects, some translators (likePubMed.js
) do not follow that specification.As for a fix, I can make a PR that compares the serialized JSON of both items instead, which should be sufficient since one of the two has been serialized already.