Commit graph

15122 commits

Author SHA1 Message Date
Abe Jellinek
c8c752663f Update reader submodule 2025-04-22 11:07:13 -04:00
Dan Stillman
bbf4692b99 Don't log entire byte array when downloading files 2025-03-15 23:07:17 -04:00
Dan Stillman
56f182f816 Fix file downloads timing out after 30 seconds
We switched file downloads to use XHR to fix downloads failing via
authenticated proxies in fx115+, but that made them subject to our
default 30-second timeout in `Zotero.HTTP.request()`. That timeout uses
the XHR `timeout` property, which applies to the whole request, even if
data is actively being downloaded. As a result, file downloads would
fail for people downloading large files or on very slow connections.

This implements manual connect and inactivity timeouts when using
`Zotero.HTTP.download()`. Currently, these both use `options.timeout`,
or the default 30 seconds, but we could probably take separate options
and have lower defaults now that they no longer apply to the whole
request.
2025-03-15 22:54:35 -04:00
Dan Stillman
6053321766 Update version 2025-03-15 22:54:27 -04:00
Dan Stillman
9828edc2e2 Update version 2025-03-12 23:25:33 -04:00
Dan Stillman
35064caddd Update translators and styles 2025-03-12 23:25:32 -04:00
Dan Stillman
601358f24b Fix very slow purging of itemDataValues at startup in large databases
When an item is erased (removed from the trash or cleaned up from a
feed), we set a flag to purge values in `itemDataValues` on the next
startup, with this query:

DELETE FROM itemDataValues WHERE valueID NOT IN (SELECT valueID FROM itemData);

For some people, that query was incredibly slow and would result in
Zotero intermittently hanging on "Loading items…" for a long time at
startup. It's possible this is mostly limited to people who subscribe to
high-volume feeds and have a lot of item churn. One affected person had
>900K values in `itemDataValues` despite having only 20K items.

It turns out the slow query is due to the foreign-key constraint on
`itemData(valueID)` that references`itemDataValues(valueID)`. SQLite is
checking every row being deleted from `itemDataValues` against
`itemData`, even though the query is specifically removing rows that
don't exist in `itemData`! For the 900K-value DB, disabling foreign-key
checks causes the `DELETE` query to take 25 seconds instead of...some
much longer time that I didn't wait for.

We already had an `executeTransaction()` flag, `disableForeignKeys`, to
temporarily disable foreign-key checks, but it didn't do so in a way
that was safe for post-initialization usage -- a write query outside of
a transaction could've run between the transaction commit and
foreign-key checks being re-enabled. This commit changes it to properly
block all other queries unless they include an `ignoreDBLock` option,
meaning that queries within the function passed to the transaction need
to include that option. (And since that's not realistic for the couple
other uses of `disableForeignKeys` -- one for a test and one in code
that almost certainly hasn't been run by anyone in 15 years -- those now
just run `PRAGMA foreign_keys=OFF|ON` explicitly, leaving this as the
only current use.)
2025-03-12 23:25:32 -04:00
PChemGuy
f4b531e657 Sort strings naturally or alphabetically (#5075)
Hidden setting. If true, use natural collection sorting matching the current behavior. If false, use conventional alphabetic sorting.
2025-03-12 23:25:32 -04:00
Abe Jellinek
c93a0e0e80 Add tests for renderItemTitle() 2025-03-12 23:25:32 -04:00
Abe Jellinek
096cc2e27b renderItemTitle(): Create <span> when inverting style
Creating an <i> with a style attribute that *removes* italics is just
too confusing.
2025-03-12 23:25:32 -04:00
Abe Jellinek
5ae1986f79 renderItemTitle(): Fix nested tag handling when rendering to string
Need to exit the loop regardless of whether we're rendering actual
nodes.

Fixes #5082
2025-03-12 23:25:32 -04:00
Dan Stillman
66d83ec4c8 Prevent DNS/TCP connections in snapshots 2025-03-12 23:25:32 -04:00
abaevbog
b250aed79d always trim editableText from itemBox on blur (#5081)
So that whitespaces are removed even if the itemBox
does not refresh.

Fixes: #5080
2025-03-12 23:25:32 -04:00
Dan Stillman
85b97f82e6 Fix /connector/saveSnapshot test for Zotero.HTTP.download() 2025-03-12 23:25:32 -04:00
Dan Stillman
64b444752a Update "Find Full Text" tests for Zotero.HTTP.download()
Downloads are now included in request() call counts
2025-03-12 23:25:32 -04:00
Dan Stillman
0542010659 Fix Zotero.HTTP.download() for fx115
Blob#bytes() was introduced in fx128.
2025-03-12 23:25:31 -04:00
Dan Stillman
4b78b2c130 Replace Zotero.Utilities.Internal.saveURI() with Zotero.HTTP.download()
Adds a new function, Zotero.HTTP.download(), that uses
Zotero.HTTP.request(). This fixes downloads via authenticated proxies in
Zotero 7 and gives us other request() functionality (e.g., 5xx retrying)
for free.

The downside is that this is probably less efficient, potentially
loading large downloads in memory. We should create a replacement for
request() based on fetch() that supports getting the body as a
ReadableStream.

Fixes #5062
2025-03-12 23:09:47 -04:00
Abe Jellinek
7f6a07b665 Advanced Search: Remove red background from condition tooltips
Fixes #5066
2025-03-12 22:59:36 -04:00
Martynas Bagdonas
fbd3fd5ceb Update reader submodule 2025-03-12 18:26:21 +02:00
Martynas Bagdonas
6ddc360145 Update reader submodule 2025-03-12 12:17:06 +02:00
Martynas Bagdonas
63b06f4346 Update reader submodule 2025-03-01 14:30:28 +02:00
Martynas Bagdonas
71375b15a5 Update reader submodule 2025-02-25 17:24:46 +02:00
Dan Stillman
c6b7829501 Update version 2025-02-21 01:37:48 -05:00
Dan Stillman
1bad050d7f Update build script for 7.0 branch 2025-02-21 01:37:48 -05:00
Dan Stillman
239530c515 CI: Build ZIP for 7.0 branch 2025-02-21 01:37:43 -05:00
Dan Stillman
828e0c942a Update Word for Mac submodule 2025-02-21 00:06:48 -05:00
Martynas Bagdonas
cf37dfb330 Update reader submodule 2025-02-20 20:13:17 +02:00
Dan Stillman
6af5a484fd Update build script for 7.0.12-hotfix branch 2025-02-19 04:08:36 -05:00
Dan Stillman
7de623accf CI: Install libdbus-glib
Needed for fx115, but apparently removed from the latest GitHub Actions
Ubuntu runner
2025-02-19 02:16:02 -05:00
Dan Stillman
10b3b5f915 Update translators 2025-02-19 02:03:27 -05:00
Adomas Venčkauskas
051280fc43 Update ScienceDirect cf captcha selector 2025-02-19 02:03:27 -05:00
Abe Jellinek
264f55545a Fix faulty siblings-of-type check in setAutoAttachmentTitle() (#5045) 2025-02-19 02:03:26 -05:00
Dan Stillman
184671f919 Fix sync not downloading queued objects on first sync of session
`firstInSession` wasn't being properly set, so previously failed data
objects weren't being retried until a manual sync. Local files also
weren't being scanned for changes for three hours, but that's probably
better in the age of DB-stored annotations, so leave that off for now
and address properly in #5025.
2025-02-19 02:03:26 -05:00
Dan Stillman
24c7f146b3 Don't open new copies of runJS/scaffold/csledit
Possible we'll get complaints about no longer being able to open
multiple copies of at least runJS and csledit, and we can reconsider if
so, but reopening the existing window is certainly the intended
behavior.
2025-02-19 02:03:26 -05:00
Abe Jellinek
707c71506f Check editability based on tab when adding attachments (#4936)
And make `get[Selected/Sorted]Items()` and `canEdit[Library/Files]()` tab-aware
2025-02-19 02:03:26 -05:00
Abe Jellinek
569bd1ffae Item box: Fix missing Copy/Paste menuitems on URL fields (#5001) 2025-02-19 02:03:26 -05:00
Dan Stillman
62d46d337a Fix selectItems() not selecting non-top-level item in trash
https://forums.zotero.org/discussion/comment/484380/#Comment_484380

Adds `Zotero.Item#isInTrash()` that returns true if the item or any of
its ancestors is in the trash (i.e., `.deleted == true`)
2025-02-19 02:03:26 -05:00
Dan Stillman
ce0f7c0378 Use commas in file size in over-quota error 2025-02-19 02:03:25 -05:00
Dan Stillman
d2c9a310a8 Tests for Item#fromJSON() changes (#3422) 2025-02-19 02:03:25 -05:00
Dan Stillman
b4bf86915b Item#fromJSON(): Don't process any Extra rows in strict mode
And enable migration of Extra rows to valid fields in non-strict mode,
but since that's only used by translators now, that probably won't do
anything

Fixes #3422
2025-02-19 02:03:25 -05:00
Dan Stillman
8804effba4 Don't auto-select item after sync on upload error
Bug from 2017
2025-02-19 02:03:25 -05:00
Dan Stillman
dfde08852a Update reader submodule 2025-02-19 02:03:25 -05:00
Abe Jellinek
006a787272 Add key to Advanced Search menuitem
Fixes #4978
2025-02-19 02:03:25 -05:00
Dan Stillman
0424faee42 Unset Mozilla environment variables when launching files and URLs (#4983)
Fixes #4981
2025-02-19 02:03:25 -05:00
windingwind
3c9dcc94bc Fix attachments box race condition (#4997)
fix: #4611
Since the attachment preview already has a task queue,
don't skip render calls when rendering
2025-02-19 02:03:24 -05:00
Adomas Venčkauskas
4bc61273a0 Fix integration session breaking when an error is thrown during getDocument() 2025-02-19 02:03:24 -05:00
windingwind
59b3268d01 Fix dense call to setItemDownloadPercentage freezes app (#4979) 2025-02-19 02:03:24 -05:00
Dan Stillman
ddb1daabbc Fix json[c.field] is undefined sync error
Fix error if local note or attachment is added to a parent item while
the remote version was added to a collection. Now, the new local parent
item will be added to any collections the remote child item was added
to.

Fixes #2934
2025-02-19 02:03:24 -05:00
Tom Najdek
d0debc0bed Fix Metadata Retrieval to correctly display the recognized item's title 2025-02-19 02:03:24 -05:00
Adomas Venčkauskas
b5b59062a7 Refresh document with delayed citation updates when changing style
Closes #4974
2025-02-19 02:03:24 -05:00