Commit graph

16686 commits

Author SHA1 Message Date
Dan Stillman
2f6abfbb27 Update reader submodule 2026-09-04 15:36:37 -04:00
Dan Stillman
bb48143ed8 Update Retraction Watch reason descriptions
Retraction Watch has renamed, merged, and added reason terms since these
were added, leaving only 65 of the 102 entries matching a term still in
use. 90% of retracted items had at least one reason that didn't show a
description, and 21% showed none at all. Rebuilt from the current
Appendix B list, which covers every reason in the data.

(cherry picked from commit 54cea6cc37)
2026-09-04 14:04:29 -04:00
Martynas Bagdonas
72e8b7be39 Update document-worker submodule
(cherry picked from commit 9086156a91)
2026-09-03 11:39:05 -04:00
Dan Stillman
516a98d0db Center single-paragraph items pane status messages when they wrap
Status messages were left aligned for the multi-paragraph intro text,
but in a narrow window, that made single lines that wrapped sit
off-center, so center those instead.

(cherry picked from commit 0e00c1ce51)
2026-09-02 22:20:48 -04:00
Dan Stillman
d62b044386 Shim removed selection methods when a single row is selected
Plugins written for earlier versions call methods like
CollectionTree#getSelectedSearch(), which now throw. We did this
intentionally to make old code more obviously broken, even with single
selection, so developers would fix their code, but we're not yet
blocking plugins that illegitimately declared compatibility with a
future version, so some haven't been updated and are breaking Zotero.
With a single row selected, the pre-10 functions can technically
continue to work, so for now, restore them and just warn and name the
plugin instead of throwing. They still need to throw if multiple rows
are selected, since plugins that haven't been updated can't safely act
on a selection that might span collections or libraries.

https://forums.zotero.org/discussion/133565/

(cherry picked from commit 5697ee0af7)
2026-09-02 22:20:46 -04:00
Dan Stillman
1347e2642b Name the responsible plugin when the items list fails to load
A plugin that monkey-patches a method in the item list's load path --
say, Zotero.CollectionTreeRow.prototype.getItems() -- can throw and
leave the pane showing only "Error loading items list", with nothing in
the error report to identify it. Update the message to name the culprit.

https://forums.zotero.org/discussion/133565/

(cherry picked from commit fac6c8ebf6)
2026-09-02 22:20:43 -04:00
Dan Stillman
f908bcadfa Fix "false" in Added By/Modified By columns for trashed collections
The row values were computed with `row.isItem && …`, so collection and
search rows in the trash got the boolean `false`, which the table then
rendered as the text "false".

https://forums.zotero.org/discussion/133560/

(cherry picked from commit 08ed64f17f)
2026-09-02 12:18:47 -04:00
Dan Stillman
dbffb22ce3 Update translators submodule 2026-09-01 23:03:57 -04:00
Dan Stillman
e4964b3a34 Update locales from Transifex 2026-09-01 23:03:07 -04:00
Dan Stillman
7fe1162405 Don't clear the saved session if startup fails
Zotero.Session.save() runs from a quit-application-granted observer
registered before the database checks, but session.json is only read
after them, so a startup error -- an incompatible database from a newer
version, say -- meant that quitting overwrote the file with an empty
state and all open tabs were lost.

https://forums.zotero.org/discussion/133542/

(cherry picked from commit 9e28eb0d39)
2026-09-01 22:57:43 -04:00
Dan Stillman
ec128e020a Fix sync error due to invalid attachment filename
A stored-file path of 'storage:/' -- left behind by the 128 schema step,
which skipped paths with no basename -- triggered an
NS_ERROR_FILE_UNRECOGNIZED_PATH that aborted the whole
checkForUpdatedFiles() loop, so no files synced in the library. Skip an
attachment that throws instead of failing the whole library.

Also apply the setter's directory-path rule in getFilePath[Async]() to
avoid errors elsewhere.

https://forums.zotero.org/discussion/133523/synchronize-issue

(cherry picked from commit 661843b03f)
2026-09-01 22:57:41 -04:00
Dan Stillman
b66bf5198f Show recently used collections in the Add to Collection menu
Collections are now tracked as they're selected, added to, or dropped
on, and the five most recent usable targets are listed above the
full collection hierarchy by full path.

(cherry picked from commit 631a0e3081)
2026-09-01 22:01:58 -04:00
Dan Stillman
36dc88ce08 Fix error using a CSL 0.8 style
transformToDocument() needs a load group, which it takes from the source
document or from the window that created the XSLTProcessor. Neither of
those has existed since 0f2690eb75 in Zotero 8 stopped taking
XSLTProcessor from the hidden window, so the CSL 0.8 → 1.0 upgrade threw
NS_ERROR_FAILURE. In Word, this showed as "Zotero encountered an error
while updating your document."

https://forums.zotero.org/discussion/133543/

(cherry picked from commit 4a8a88dd41)
2026-09-01 15:49:23 -04:00
Dan Stillman
501ecc895c Fix the startup error shown when the database can't be written to
Regression from b27c4cb023 in 10.0, which added pragma commands that
write to the database. If those failed because the database was
read-only, we would show a raw SQLite error instead of the message about
permissions.

https://forums.zotero.org/discussion/133521/error-for-zotero-10-for-mac

(cherry picked from commit 984a72a3d9)
2026-08-31 14:29:58 -04:00
Dan Stillman
b18ecd3310 Revoke the server API key if it can't be stored locally
The login session creates a key on the server before we try to store it,
so each attempt that failed to save the key left an active key behind.

(cherry picked from commit 30425e024d)
2026-08-31 12:43:47 -04:00
Dan Stillman
72331fec51 Reset the account pane if the login session can't be stored
If storing the API key failed, the pane kept showing the spinner and
"Waiting for login…" until the user clicked Cancel, even though the
login attempt was already over.

https://forums.zotero.org/discussion/133418/

(cherry picked from commit c19177a469)
2026-08-31 12:43:47 -04:00
Dan Stillman
cc408d0a72 Report the real cause of an OS keystore failure
Every failure shows "User canceled OS unlock entry" no matter what went
wrong. Test the store for the actual state, and give callers a message
describing what couldn't be accessed.

(cherry picked from commit ace9fa0227)
2026-08-31 12:43:47 -04:00
Dan Stillman
799c05c598 Don't show credential dialogs during automatic syncs
Both the keystore fallback prompt and the migration alert are reachable
from the credential read paths that a sync uses, so don't show if it's
an automatic sync.

(cherry picked from commit 57c8c81872)
2026-08-31 12:43:47 -04:00
Dan Stillman
89a24224c0 Fall back to saving credentials without OS keystore encryption
Some Linux systems have no Secret Service running, and if users can't
change that (e.g., a managed system), storing an API key fails and login
never completes. Offer to store credentials unencrypted instead, and try
to encrypt them on a later read if the keystore becomes usable.

https://forums.zotero.org/discussion/133418/

(cherry picked from commit 892898040b --
with modifications, since 10.0's login manager calls are synchronous)
2026-08-31 12:43:21 -04:00
Dan Stillman
93b44b91e0 Fix the window lookup for OS keystore alerts
'zotero:main' isn't a registered window type, so the lookup always
returned null and the alerts were never shown.

https://forums.zotero.org/discussion/133418/

(cherry picked from commit d276ec19c5)
2026-08-31 12:40:34 -04:00
Dan Stillman
32be699862 Fix WebDAV downloads with non-ASCII characters in the password
Some checks failed
CI / Detect changes (push) Has been cancelled
CI / Utilities Tests (push) Has been cancelled
CI / Build, Upload (push) Has been cancelled
CI / Test () (push) Has been cancelled
CI / Test (macOS NFS) (push) Has been cancelled
HTTP.download() built the Basic auth header with btoa(), which throws
on code points above 255, so every file download failed immediately
with a TypeError. Requests that go through XMLHttpRequest were
unaffected, since Necko builds the header itself, UTF-8 encoded.

https://forums.zotero.org/discussion/133454/synchronization-error-after-upgrading-to-10-0-1

(cherry picked from commit 3b93d33b35)
2026-08-27 10:53:47 -04:00
Dan Stillman
6befe6827d Fix corruption of non-ASCII characters in encrypted credentials
Mozilla's OSKeyStore.encrypt() encodes the string as UTF-8 before
encrypting, but its decrypt() returns the decrypted bytes as a binary
string without decoding them, so a WebDAV password containing non-ASCII
characters came back mojibake and authentication failed.

https://forums.zotero.org/discussion/133465/problem-login-into-webdav-server-with-10-0-1

(cherry picked from commit 0c9ba2d05c)
2026-08-27 10:53:44 -04:00
Mynacol
08f3e1e5dd Use versioned libc.so instead of /bin/ln on Linux (#6030)
* Fix js-ctypes-based symlinking on Linux by using `libc.so.6` instead of `libc.so` in `OS.File.unixSymlink()` and `Zotero.File.createSymlink()`
* Use that instead of `/bin/ln`, which doesn't exist on NixOS
* Replace `/bin/ln` with `Zotero.File.createSymlink()` in symlinked-database test

---------

Co-authored-by: Dan Stillman <dstillman@zotero.org>

(cherry picked from commit d153397151)
2026-08-27 10:53:42 -04:00
Dan Stillman
a5bff10865 Don't use FSEvents when storage isn't on a local volume
Some checks are pending
CI / Detect changes (push) Waiting to run
CI / Test () (push) Blocked by required conditions
CI / Test (macOS NFS) (push) Blocked by required conditions
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
FSEvents is backed by a per-volume journal that only local volumes
have. On a network mount the stream is created and started
successfully but never delivers events, so the watcher would report
that nothing had changed for as long as it was used. Check the volume
with statfs() and fall back to scanning.

(cherry picked from commit 5d20c692e8)
2026-08-26 10:37:48 -04:00
Dan Stillman
1ee75da2f7 Fix locally missing attachments never being downloaded
Since f21e1b2d32, a full local file scan no longer runs periodically and
on every manual sync, so locally missed attachments stayed marked for
upload and were skipped as unavailable instead of being downloaded.
"Reset File Sync History" marked every attachment for upload, including
files that had never been downloaded, so the forced download check added
in 404fc41b88 found nothing to download.

Missing files are now marked for download when the upload queue is
filled, and in at-sync-time mode they're downloaded in the same sync.
The reset marks them for download directly, and downloads are no longer
skipped just because there were no remote storage changes.

https://forums.zotero.org/discussion/133414/
(cherry picked from commit a1ea7037c2)
2026-08-26 10:37:44 -04:00
Dan Stillman
33297dd19a Update version
Some checks are pending
CI / Detect changes (push) Waiting to run
CI / Test () (push) Blocked by required conditions
CI / Test (macOS NFS) (push) Blocked by required conditions
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
2026-08-25 15:27:37 -04:00
Dan Stillman
93b9106451 Fix dragging attachments to File Explorer
Firefox 140.14 in Zotero 10.0 made the drag transferable's data
principal null for chrome-initiated drags, so the file-promise stream
that File Explorer used couldn't be created and the drop failed with
"Unspecified error". On Windows the promise was just a file:// URL for
the attachment itself, so hand over the file directly instead, and
force a copy so that File Explorer doesn't move it out of storage.

https://forums.zotero.org/discussion/133399/
https://bugzilla.mozilla.org/show_bug.cgi?id=2054665

(cherry picked from commit 56eb77b704)
2026-08-25 15:26:32 -04:00
Dan Stillman
36749bd0bd Update locales from Transifex
Some checks are pending
CI / Detect changes (push) Waiting to run
CI / Test () (push) Blocked by required conditions
CI / Test (macOS NFS) (push) Blocked by required conditions
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
2026-08-24 11:14:30 -04:00
Dan Stillman
26ac397352 Fix stuck "Loading items" at startup
The collections tree selects a row as soon as it's initialized, which
raced with the items tree's initialization. If the collections tree won,
onCollectionSelected() threw on the missing items view and no items were
ever loaded.

https://forums.zotero.org/discussion/133379/
https://forums.zotero.org/discussion/133380/
2026-08-24 10:39:10 -04:00
Dan Stillman
50976f4bbd Retry note saves that time out waiting for the database
Some checks failed
CI / Detect changes (push) Has been cancelled
CI / Utilities Tests (push) Has been cancelled
CI / Build, Upload (push) Has been cancelled
CI / Test () (push) Has been cancelled
CI / Test (macOS NFS) (push) Has been cancelled
Any error while saving a note prompted the user to restart Zotero, even
a transaction timeout caused by a long-running operation elsewhere.
Nothing has been written when the wait times out, so retry, unless newer
note content has been handed to the editor in the meantime.

https://forums.zotero.org/discussion/133298/

(cherry picked from commit f2a42bec15)
2026-08-21 16:43:29 -04:00
Dan Stillman
e192f10672 Don't hold the database to optimize the full-text index
Editing a note flagged it stale, and the background drain indexed it and
then ran an FTS5 'optimize' -- a single statement that rewrites the
content index and can hold the shared database for over a minute --
because the queue was empty again. Note saves waiting on the connection
hit the transaction timeout and told the user to restart Zotero.

Merge the index in bounded steps instead, so no statement runs long
enough to keep other queries waiting, and only after enough items have
been indexed to be worth it.

https://forums.zotero.org/discussion/133298/

(cherry picked from commit 070ae8b615)
2026-08-21 16:41:17 -04:00
Dan Stillman
6680877c88 Open the database only once when callers arrive concurrently
_getConnectionAsync() checked for an existing connection and then awaited
several filesystem operations before assigning one, so callers arriving in
that window each opened their own. Only the last was kept, and the rest
stayed open and unreachable, holding a mozStorage thread apiece until
shutdown.

(cherry picked from commit e8055dfdf2)
2026-08-21 16:38:53 -04:00
Dan Stillman
9a558f49cf Stop observing idle after the database is closed permanently
A permanently closed connection kept its idle observer, so it went on
being notified and attempting backups for the life of the process. This
affects plugin databases, which are closed permanently when the plugin
shuts down.

(cherry picked from commit 9e45191b22)
2026-08-21 16:38:39 -04:00
Dan Stillman
352562ec71 Register the DB backup idle observer only once per connection
The observer was added on every open with no matching removal, so each
reopen left behind another registration that received its own idle
notification. On macOS, where the periodic backup closes and reopens the
connection, the registrations accumulated and multiplied the work done
on each idle.

Addresses #6027

(cherry picked from commit 7243648ed7)
2026-08-21 16:29:23 -04:00
Dan Stillman
92d2a1b7ff Don't back up an unchanged database
currentDBTime and lastBackupTime became Date objects when the backup was
made asynchronous in 2014, so comparing them with == has tested object
identity and returned false ever since. The interval check that follows
measures from the backup file's mtime, which a copy inherits from the
database file, so an unchanged database was backed up on every idle.

Fixes #6027

(cherry picked from commit 85e1cbc75c)
2026-08-21 16:29:23 -04:00
Dan Stillman
95a6d8821e Fix Any Field searches at a non-item result level
Any Field expands to a generic 'field' condition, which the cross-level
code treated as matching only on top-level items. At an attachment
result level it therefore matched attachments whose parent item had the
value, instead of attachments with the value themselves. Since the
condition stands in for every field, it's now treated as matching at any
level those fields live at.

(cherry picked from commit ad98e84d24)
2026-08-21 12:56:53 -04:00
Dan Stillman
8bc2d48319 Don't prompt to save an unchanged saved search
Some checks are pending
CI / Detect changes (push) Waiting to run
CI / Test () (push) Blocked by required conditions
CI / Test (macOS NFS) (push) Blocked by required conditions
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
https://forums.zotero.org/discussion/133302/zotero-10-questions-about-search
(cherry picked from commit 0ee3e4052e)
2026-08-20 15:40:08 -04:00
Dan Stillman
7f074b1924 Run network-filesystem tests only for relevant changes, and on macOS
Some checks are pending
CI / Detect changes (push) Waiting to run
CI / Test () (push) Blocked by required conditions
CI / Test (macOS NFS) (push) Blocked by required conditions
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
Run the smb/nfs test shards and a new macOS NFS job only when the
changes touch the Gecko version or the network-filesystem database
handling, plus on manual and monthly scheduled runs, via a 'changes'
job feeding the test matrix. The macOS job uses the native NFS server
with a loopback mount and runs the real code path that crashed on
network data directories on macOS.

(cherry picked from commit ed8049dffc)
2026-08-19 11:13:40 -04:00
Dan Stillman
ecf033eae1 Show in-window message in style preview instead of progress popup
Since 30b5bf4bb9, the popup opens as a dependent window of the main
window, so it appeared behind the Style Preview window and, on Windows,
brought the main window to the front.

https://forums.zotero.org/discussion/133296/
(cherry picked from commit e1759daa00)
2026-08-19 10:56:06 -04:00
Dan Stillman
8d68f6cb89 Skip symlink tests on filesystems without symlink support
CIFS mounts can't create real symlinks without special mount options,
so skip the symlinked-database and broken-symlink tests when a created
symlink doesn't exist or isn't visible as one.

(cherry picked from commit 4e532a17a2)
2026-08-19 09:41:57 -04:00
Dan Stillman
145c78d587 Use offline database backups on network filesystems on Linux
The online backup API writes the backup file through SQLite's default
VFS, whose locking can hang on network filesystems -- its lock upgrades
conflict with the SMB byte-range lock mapping on CIFS mounts and retry
forever -- so fall back to an offline backup, which copies the file
with the connection closed. Extends getFileSystemInfo() to Linux using
statfs f_type magic numbers.

(cherry picked from commit ad1bec62f2)
2026-08-19 09:41:57 -04:00
Dan Stillman
cd2a1d1212 Add CI test shards with the data directory on SMB and NFS shares
Adds 'smb' and 'nfs' entries to the test matrix that run the DB and
file test suites with the test data directory on a loopback CIFS or
NFS mount, covering the network-filesystem database handling from
bba85a3939. The test harness places the data directory under TMPDIR,
so connection initialization itself runs against the share, which is
where network-filesystem failures (startup crashes and hangs) occur.
The step timeout turns a startup hang into a failure.

(cherry picked from commit 18f6fa50d5)
2026-08-19 09:41:56 -04:00
Martynas Bagdonas
e01e6ef9f5 Fix annotations not appearing when imported while reader is opening
Fixes https://forums.zotero.org/discussion/133270/bug-embedded-pdf-annotations-and-highlights-fail-to-render-in-zotero-reader

(cherry picked from commit db1216d3e2)
2026-08-19 09:20:53 -04:00
Dan Stillman
16a79acf7c Update version
Some checks are pending
CI / Test (shard 3) (push) Waiting to run
CI / Test (shard 4) (push) Waiting to run
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
CI / Test (shard 1) (push) Waiting to run
CI / Test (shard 2) (push) Waiting to run
2026-08-18 17:45:06 -04:00
Dan Stillman
2913397bf2 Fix doubled Index Statistics numbers after searching in preferences
The preferences search feature moves label value attributes into text
content for highlighting, so stats refreshes that set the value
attribute rendered the new number in front of the stale text.

https://forums.zotero.org/discussion/comment/516909/#Comment_516909
(cherry picked from commit b6837a3a57)
2026-08-18 17:43:01 -04:00
Dan Stillman
59a3568213 Fix database access on network filesystems on macOS and Linux
On macOS, SQLite chooses locking methods based on the filesystem
containing the database, and network filesystems (e.g., SMB, NFS),
read-only volumes, and filesystems without byte-range locking get
methods without shared-memory support, which WAL requires. Opening a
database with an adjacent WAL file on those crashes -- Mozilla's VFS
wrapper hides the missing shared-memory methods from SQLite's WAL
support check -- so the first Zotero 10 run converted the database to
WAL and every launch after that segfaulted during connection
initialization.

On macOS, mirror SQLite's method selection and use a rollback journal
when shared memory isn't available, converting an existing WAL database
before opening it: an empty WAL by reverting the header format versions
in place, and a non-empty WAL by replaying it into a temporary copy on
local disk that replaces the database file only after passing an
integrity check. A WAL file next to an already-converted database
(e.g., from an interrupted conversion) goes through the same
conversion. Also use openNotExclusive during integrity checks and
corruption recovery, which otherwise fail on SMB shares with an I/O
error from the exclusive open lock.

This corrects 22055d92b7, which passed openNotExclusive on all
platforms for an open failure described as affecting macOS and Linux,
and expected locking_mode=EXCLUSIVE to keep the WAL index in heap
memory with no -shm file. Neither claim held up: mozStorage opens the
WAL while initializing the connection, before any pragma can run, so
the index uses shared memory unless the exclusive VFS is in use, and
the exclusive open works on Linux CIFS mounts -- where non-exclusive
access instead made SQLite's lock-upgrade sequence trip over the SMB
byte-range lock mapping, leaving startup hung and the database never
created. So pass openNotExclusive only on macOS. On Linux this restores
unix-excl, which performs all locking under a single held lock and
keeps the WAL index in heap memory; Windows has no distinct exclusive
VFS and is unaffected.

https://forums.zotero.org/discussion/133258/

(cherry picked from commit bba85a3939)
2026-08-18 17:24:44 -04:00
Dan Stillman
22f08d1ced Fix changelog URL generation for two-digit major versions
Some checks are pending
CI / Test (shard 1) (push) Waiting to run
CI / Test (shard 2) (push) Waiting to run
CI / Test (shard 3) (push) Waiting to run
CI / Test (shard 4) (push) Waiting to run
CI / Utilities Tests (push) Waiting to run
CI / Build, Upload (push) Waiting to run
The short version was derived from the first three characters of the
version string, so 10.0 produced a detailsURL of "10._changelog".

(cherry picked from commit 5757396197)
2026-08-17 12:30:00 -04:00
Dan Stillman
395224d7ac Update release script to 10.0 branch
And delete 8.0 script
2026-08-17 10:42:31 -04:00
Dan Stillman
4d571e2b74 Update to Firefox 140.14.0esr 2026-08-17 10:23:34 -04:00
Dan Stillman
89c835bfc6 Fix locale update script under rpl 2.x
rpl 2.1.0 guesses each file's character encoding instead of assuming
UTF-8, and aborts on some locale files, leaving the script's later
steps unrun. Pin the encoding, and use -exec + so a failure in one of
these passes actually stops the script.

Also drop the ⏎ replacement, which hasn't matched anything since 2013
and would now insert real newlines rather than literal \n, truncating
.properties entries.

(cherry picked from commit 5a6c9245f0)
2026-08-17 09:58:44 -04:00