Commit graph

15274 commits

Author SHA1 Message Date
Dan Stillman
8ddb6bfd17 Remove code to modify Zotero.DB properties via transaction options
No idea why this was ever here, but I don't think it's actually used
(and if it is, it shouldn't be). The only options I see are handled
directly within `executeTransaction()` itself.
2025-03-10 04:26:16 -04:00
Dan Stillman
e532e435f4 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-10 04:26:16 -04:00
Dan Stillman
659d5e864b build_and_run: Fix handling of ZOTERO_PROFILE containing spaces 2025-03-09 16:16:47 -04:00
Abe Jellinek
ac0813e0f5
Restore window controls on Windows/Linux (#5083) 2025-03-07 16:24:46 -05:00
PChemGuy
8a06edab49
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-07 02:08:11 -05:00
Abe Jellinek
679de040ec Add tests for renderItemTitle() 2025-03-06 11:00:33 -05:00
Abe Jellinek
8082516bf6 renderItemTitle(): Create <span> when inverting style
Creating an <i> with a style attribute that *removes* italics is just
too confusing.
2025-03-06 11:00:32 -05:00
Abe Jellinek
c9c9c500bf 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-06 10:20:13 -05:00
Dan Stillman
d931319b12 Prevent DNS/TCP connections in snapshots 2025-03-06 01:46:38 -05:00
Dan Stillman
d7ce4191b1 Remove chai-as-promised submodule
We've included this in package.json for many years, so this shouldn't be
here.
2025-03-05 22:59:49 -05:00
abaevbog
d0bf8f8993
always trim editableText from itemBox on blur (#5081)
So that whitespaces are removed even if the itemBox
does not refresh.

Fixes: #5080
2025-03-05 18:03:03 -05:00
Dan Stillman
05f3ea3b82 Update reader submodule 2025-03-05 07:30:21 -05:00
Dan Stillman
8021ca0a0b Fix /connector/saveSnapshot test for Zotero.HTTP.download() 2025-03-05 07:18:12 -05:00
Tom Najdek
6add721e68
Convert customThemes from a pref to a synced setting (#5071) 2025-03-05 06:43:52 -05:00
Dan Stillman
a464fe0408 Update "Find Full Text" tests for Zotero.HTTP.download()
Downloads are now included in request() call counts
2025-03-05 06:34:25 -05:00
abaevbog
d3cee95fb7
Click on itemBox label focus edits (#5065)
Click on a label of a focused field will refocus itemTree
or the reader content, depending on the tab. That way
focus is not lost.

Fixes: #5063
2025-03-05 05:59:11 -05:00
Dan Stillman
c262a5b392 Add Cr as glboal in eslint config 2025-03-05 05:51:04 -05:00
Dan Stillman
3a26ce3bb1 Avoid args is undefined logged error in file sync tests 2025-03-05 05:50:58 -05:00
Dan Stillman
1f401f0897 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-05 04:46:51 -05:00
windingwind
ccc1800f21
Fix attachment preview background (#5067)
regression from 9c41874
2025-03-04 09:45:22 -05:00
Abe Jellinek
cab8e38806
Remove deleted actors to prevent console spam (#5074) 2025-03-04 09:45:08 -05:00
Abe Jellinek
5c8859b618 RemoteTranslate: Fix request methods not sending cookies 2025-02-28 15:22:37 -05:00
Abe Jellinek
c19f43ea46 Scaffold: Suppress ESLint JSON.parse() syntax errors 2025-02-28 15:16:26 -05:00
Abe Jellinek
1e08985dcd Scaffold: Accept shorthand URLs in URL box
Like "google.com" instead of "https://www.google.com/".
2025-02-28 15:16:12 -05:00
Dan Stillman
307753d313 "Select add-on to install" → "Select plugin to install"
https://forums.zotero.org/discussion/122235/title-in-the-plugin-selection-windows-dialog-add-on-plugin
2025-02-27 23:30:45 -05:00
windingwind
1b64e3417c
Fix web-ext support (#5068) 2025-02-27 22:28:42 -05:00
Abe Jellinek
6f8da4825e Advanced Search: Remove red background from condition tooltips
Fixes #5066
2025-02-26 16:41:07 -05:00
Abe Jellinek
ba7b521bb1 Scaffold: Clean up load() slightly 2025-02-26 12:09:06 -05:00
Abe Jellinek
ddb5977c48 Scaffold: Remove 2028/2029 fix
Hasn't been an issue since ES2019.
2025-02-26 11:27:02 -05:00
Martynas Bagdonas
9077310669 Update pdf-worker submodule 2025-02-26 18:10:58 +02:00
Abe Jellinek
3c8d50dd47 Remove loadBrowserWindow() test support function (#5050)
A browser window was no longer actually needed for charset detection
(on macOS, at least, and hopefully elsewhere) because we switched to a
HiddenFrame-based hidden browser. Remaining uses now call
`loadZoteroWindow()`.
2025-02-26 03:00:04 -05:00
Abe Jellinek
26221b6786 Fix broken browser window on print + remove many Mozilla files (#5050) 2025-02-26 03:00:04 -05:00
Abe Jellinek
90a9c5164a
macOS: Unescape dragged path when NSURL doesn't (#5059) 2025-02-25 05:28:12 -05:00
abaevbog
c049120efb
do not try to select deleted item in a collection (#5061)
After navigating to the collection from "Libraries and Collections"
section of an item in the trash. Deleted item does not appear in actual
collections and trying to select it will just re-select the trash.

Fixes: #5060
2025-02-25 05:24:59 -05:00
Martynas Bagdonas
a3ebb4ad41 Update reader submodule 2025-02-25 11:24:33 +02:00
Abe Jellinek
854f2188c2 Duplicates: Fix hidden elements remaining visible
And update comment.

Fixes #5056
2025-02-24 11:18:48 -05:00
abaevbog
54346b0ca7
fix broken QF cancellation from editor instance (#5054)
Define missing cancel method on io object passed from the
editor instance to quickFormat dialog. Without this
Escape keypresses throws an error because io.cancel is
undefined.

Followup to #4859
2025-02-21 22:13:41 +02:00
Martynas Bagdonas
96e71762f9 Normalize decomposed chars in PDF text, Zotero notes for proper indexing
Fixes #5051
2025-02-21 14:55:20 +02:00
Abe Jellinek
d3871d6864 editable-text: Forward onTextEntered() from input
Fixes #5043
2025-02-20 14:40:58 -05:00
Dan Stillman
45310397e5 Update Word for Mac submodule 2025-02-20 06:28:27 -05:00
Adomas Ven
2e9b9d4070
Close citation dialog if user interacts with the integration plugin (#4859)
Asks the user if they want to discard the changes in their existing dialog if
they have made changes.

If there is no citation dialog, but a command is running (like updating the document)
an alert is displayed.

Closes #4855
2025-02-18 05:52:23 -05:00
Abe Jellinek
eb30c23a0d
Scaffold: Infer types of parameters based on naming conventions (#5038) 2025-02-18 05:07:51 -05:00
Adomas Venčkauskas
239b68e6b8 Update Word for Windows submodule 2025-02-18 11:43:51 +02:00
Adomas Venčkauskas
d231fb3b53 Do not attempt to activate windows on wayland using X11 libraries
I don't know if something changed in my Ubuntu installation or in the
Firefox runtime (probably the former), but that code crashes Zotero on
wayland.

Window activation (e.g. citation window) does not seem to be affected.
2025-02-18 10:55:22 +02:00
Adomas Venčkauskas
e765a4d3af Update ScienceDirect cf captcha selector 2025-02-18 10:53:02 +02:00
windingwind
3b7dd58c50
Update eslint ecmaVersion to es2022 (#5049)
Current firefox version supports all features of es2022
Fix errors with features like WeakRef
2025-02-17 05:53:15 -05:00
Dan Stillman
fc3b7e0f83 Local API: Fix handling of style ids without standard prefix
Follow-up to #5032
2025-02-17 03:16:22 -05:00
Dan Stillman
9c6b3368f2 Revert "Zotero.Styles: Serialize init() and remove Zotero.Promise.coroutine()"
This breaks style initialization if you trigger it manually before the
normal startup initialization.

This reverts commit d141ab25b1.

https://forums.zotero.org/discussion/121879/missing-item-pane-header
https://forums.zotero.org/discussion/121878/cannot-copy-citation-bibliography-in-reader
2025-02-17 02:19:59 -05:00
Adomas Venčkauskas
8e08527991 Update Word for Windows submodule 2025-02-13 10:36:23 +02:00
Adomas Venčkauskas
51d668db56 Update Word for Windows submodule 2025-02-13 10:30:40 +02:00