]> git.ipfire.org Git - thirdparty/paperless-ngx.git/log
thirdparty/paperless-ngx.git
3 hours agoFix: prevent scale vs page loop in pngx PDF viewer (#13406) dev
shamoon [Wed, 29 Jul 2026 16:25:37 +0000 (09:25 -0700)] 
Fix: prevent scale vs page loop in pngx PDF viewer (#13406)

4 hours agoFix: handle hidden line breaks in email subjects when sending email (#13402)
shamoon [Wed, 29 Jul 2026 14:35:30 +0000 (07:35 -0700)] 
Fix: handle hidden line breaks in email subjects when sending email (#13402)

5 hours agoFix: avoid NotSupportedError from document_importer on MariaDB (#13400)
Trenton H [Wed, 29 Jul 2026 14:14:13 +0000 (07:14 -0700)] 
Fix: avoid NotSupportedError from document_importer on MariaDB (#13400)

25 hours agoAuto translate strings
GitHub Actions [Tue, 28 Jul 2026 18:28:12 +0000 (18:28 +0000)] 
Auto translate strings

25 hours agoTweak: adjust doc details button toolbar flow (#13382)
shamoon [Tue, 28 Jul 2026 18:26:37 +0000 (11:26 -0700)] 
Tweak: adjust doc details button toolbar flow (#13382)

26 hours agoFix: exclude next-period start from relative date-range filters (#13381)
Trenton H [Tue, 28 Jul 2026 16:58:38 +0000 (09:58 -0700)] 
Fix: exclude next-period start from relative date-range filters (#13381)

* Fix: exclude next-period start from relative date-range filters

Tantivy's [lo TO hi] range is inclusive on both ends, but computed upper
bounds (keyword ranges, YYYY/YYYYMM/YYYYMMDD tokens) represent the start of
the next period. Use half-open [lo TO hi} for those so e.g. "previous month"
no longer matches the 1st of the current month.

* Adds a regression test down to the second check for the hi range

27 hours agoDocumentation: Add Password Removal workflow action documentation (#13377)
Trenton H [Tue, 28 Jul 2026 16:21:14 +0000 (09:21 -0700)] 
Documentation: Add Password Removal workflow action documentation (#13377)

Addresses discussion #13373. Documents that password removal creates a
new document version via re-consumption of the decrypted file rather
than editing in place, and explains why the Consumption Started trigger
produces an initial un-OCR'd version followed by a properly processed
one.

28 hours agoChore(deps): Bump pymdown-extensions in the uv group across 1 directory (#13378)
dependabot[bot] [Tue, 28 Jul 2026 15:29:20 +0000 (15:29 +0000)] 
Chore(deps): Bump pymdown-extensions in the uv group across 1 directory (#13378)

Bumps the uv group with 1 update in the / directory: [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions).

Updates `pymdown-extensions` from 10.21.3 to 11.0
- [Release notes](https://github.com/facelessuser/pymdown-extensions/releases)
- [Commits](https://github.com/facelessuser/pymdown-extensions/compare/10.21.3...11.0)

---
updated-dependencies:
- dependency-name: pymdown-extensions
  dependency-version: '11.0'
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
29 hours agoFix: close non-atomic db connections in before_task_publish (#13366)
shamoon [Tue, 28 Jul 2026 14:21:02 +0000 (07:21 -0700)] 
Fix: close non-atomic db connections in before_task_publish (#13366)

35 hours agoChore/fix: refactor frontend task service (#13365)
shamoon [Tue, 28 Jul 2026 07:34:30 +0000 (00:34 -0700)] 
Chore/fix: refactor frontend task service (#13365)

37 hours agoFix: fix Enter selection in search autocomplete (#13361)
shamoon [Tue, 28 Jul 2026 06:33:13 +0000 (23:33 -0700)] 
Fix: fix Enter selection in search autocomplete (#13361)

39 hours agoDocumentation: Add v3.0.4 changelog (#13356) main
github-actions[bot] [Tue, 28 Jul 2026 04:21:10 +0000 (21:21 -0700)] 
Documentation: Add v3.0.4 changelog (#13356)

40 hours agoBump version to 3.0.4 v3.0.4
shamoon [Tue, 28 Jul 2026 03:14:39 +0000 (20:14 -0700)] 
Bump version to 3.0.4

40 hours agoMerge branch 'dev'
shamoon [Tue, 28 Jul 2026 03:14:04 +0000 (20:14 -0700)] 
Merge branch 'dev'

40 hours agoNew Crowdin translations by GitHub Action (#13308)
github-actions[bot] [Tue, 28 Jul 2026 03:12:46 +0000 (20:12 -0700)] 
New Crowdin translations by GitHub Action (#13308)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
43 hours agoAuto translate strings
GitHub Actions [Tue, 28 Jul 2026 00:27:34 +0000 (00:27 +0000)] 
Auto translate strings

43 hours agoFix: prevent pdfjs highlight scrolling from affecting the entire page (#13355)
shamoon [Tue, 28 Jul 2026 00:25:52 +0000 (17:25 -0700)] 
Fix: prevent pdfjs highlight scrolling from affecting the entire page (#13355)

43 hours agoFix: don't skip OCR/archive for tagged PDFs with no actual text (#13351)
Trenton H [Mon, 27 Jul 2026 23:52:29 +0000 (16:52 -0700)] 
Fix: don't skip OCR/archive for tagged PDFs with no actual text (#13351)

45 hours agoPerformance: more performant filtering diacritic normalization (#13347)
shamoon [Mon, 27 Jul 2026 22:13:16 +0000 (15:13 -0700)] 
Performance: more performant filtering diacritic normalization (#13347)

45 hours agoPerf: prefetch notes and custom fields for LLM index text building (#13350)
Trenton H [Mon, 27 Jul 2026 21:50:37 +0000 (14:50 -0700)] 
Perf: prefetch notes and custom fields for LLM index text building (#13350)

build_llm_index_text queried Note and CustomFieldInstance (plus its
field FK) per document, uncovered by the earlier correspondent/type/
storage_path/tags prefetch fix. Add notes and custom_fields__field to
the rebuild and scoped document querysets, and read from doc.notes.all()
instead of a fresh Note.objects.filter() so the prefetch is actually used.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
47 hours agoAuto translate strings
GitHub Actions [Mon, 27 Jul 2026 19:35:15 +0000 (19:35 +0000)] 
Auto translate strings

2 days agoFix: dedupe permission-visible documents when combined with multi-tag ALL filtering...
Trenton H [Mon, 27 Jul 2026 19:33:26 +0000 (12:33 -0700)] 
Fix: dedupe permission-visible documents when combined with multi-tag ALL filtering (#13331) (#13345)

The permission filter OR'd three querysets together on top of a
queryset that could already carry two independent tags__id__all
joins, letting a document that matched more than one branch (e.g.
unowned + group-permissioned) come back twice. Replaced it with a
single id__in filter against the existing permitted_document_ids
helper, which is join-free and can't hit this.

2 days agoPerformance: Scope llm index updates to actually modified documents (#13322)
Trenton H [Mon, 27 Jul 2026 17:23:43 +0000 (10:23 -0700)] 
Performance: Scope llm index updates to actually modified documents (#13322)

* Perf: scope bulk_update_documents' LLM index refresh to the edited document ids instead of the whole library

* Perf: select_related/prefetch_related for the scoped LLM index batch

* Perf: select_related/prefetch_related for the full LLM index rebuild path

* Fix: address Copilot review findings on LLM index scoping

2 days agoAuto translate strings
GitHub Actions [Mon, 27 Jul 2026 16:53:33 +0000 (16:53 +0000)] 
Auto translate strings

2 days agoFixhancement: pass LLM output language to chat if specified (#13340)
shamoon [Mon, 27 Jul 2026 16:51:31 +0000 (09:51 -0700)] 
Fixhancement: pass LLM output language to chat if specified (#13340)

2 days agoDocumentation: fix PAPERLESS_AI_LLM_OUTPUT_LANGUAGE heading level (#13341)
Sandro [Mon, 27 Jul 2026 16:37:09 +0000 (18:37 +0200)] 
Documentation: fix PAPERLESS_AI_LLM_OUTPUT_LANGUAGE heading level (#13341)

2 days agoChore: resolve npm provenance issues with chokidar and semver (#13323)
shamoon [Sun, 26 Jul 2026 23:25:49 +0000 (16:25 -0700)] 
Chore: resolve npm provenance issues with chokidar and semver (#13323)

2 days agoAuto translate strings
GitHub Actions [Sun, 26 Jul 2026 22:38:16 +0000 (22:38 +0000)] 
Auto translate strings

2 days agoFix: ensure preview reload on live changes (#13321)
shamoon [Sun, 26 Jul 2026 22:36:03 +0000 (15:36 -0700)] 
Fix: ensure preview reload on live changes (#13321)

2 days agoFix: clamp out-of-range MailRule.order and ApplicationConfiguration DPI/page fields...
Trenton H [Sun, 26 Jul 2026 22:11:27 +0000 (15:11 -0700)] 
Fix: clamp out-of-range MailRule.order and ApplicationConfiguration DPI/page fields before smallint migration (#13316)

2 days agoFix: add docstring to DocumentClassifierSchema for cleaner LLM tool description ...
Trenton H [Sun, 26 Jul 2026 22:00:06 +0000 (15:00 -0700)] 
Fix: add docstring to DocumentClassifierSchema for cleaner LLM tool description (#13315)

2 days agoFix: guard build_document_node against stale FK on deleted correspondent/doc type...
Trenton H [Sun, 26 Jul 2026 21:45:59 +0000 (14:45 -0700)] 
Fix: guard build_document_node against stale FK on deleted correspondent/doc type (#13318)

2 days agoFix: prevent search filter loss when closing document with Escape key (#13317)
shamoon [Sun, 26 Jul 2026 21:17:26 +0000 (14:17 -0700)] 
Fix: prevent search filter loss when closing document with Escape key (#13317)

3 days agoFix: fix frontend permissions display for stats/system perms (#13305)
shamoon [Sun, 26 Jul 2026 09:56:06 +0000 (02:56 -0700)] 
Fix: fix frontend permissions display for stats/system perms (#13305)

3 days agoDocumentation: Add v3.0.3 changelog (#13300)
github-actions[bot] [Sun, 26 Jul 2026 01:57:03 +0000 (18:57 -0700)] 
Documentation: Add v3.0.3 changelog (#13300)

* Changelog v3.0.3 - GHA

* Update changelog.md

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
3 days agoBump version to 3.0.3 v3.0.3
shamoon [Sat, 25 Jul 2026 23:32:39 +0000 (16:32 -0700)] 
Bump version to 3.0.3

3 days agoNew Crowdin translations by GitHub Action (#13297)
github-actions[bot] [Sat, 25 Jul 2026 23:31:40 +0000 (16:31 -0700)] 
New Crowdin translations by GitHub Action (#13297)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
3 days agoNew Crowdin translations by GitHub Action (#13239)
github-actions[bot] [Sat, 25 Jul 2026 23:30:17 +0000 (16:30 -0700)] 
New Crowdin translations by GitHub Action (#13239)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
3 days agoDocs: warn bare-metal users about stale files when upgrading (#13296)
Trenton H [Sat, 25 Jul 2026 21:06:31 +0000 (14:06 -0700)] 
Docs: warn bare-metal users about stale files when upgrading (#13296)

4 days agoTweak: use css grid for navbar
shamoon [Sat, 25 Jul 2026 16:13:34 +0000 (09:13 -0700)] 
Tweak: use css grid for navbar

4 days agoAuto translate strings
GitHub Actions [Sat, 25 Jul 2026 07:13:46 +0000 (07:13 +0000)] 
Auto translate strings

4 days agoFixhancement: PAPERLESS_ALLAUTH_TRUSTED_PROXY_COUNT (#13281)
shamoon [Sat, 25 Jul 2026 07:12:12 +0000 (00:12 -0700)] 
Fixhancement: PAPERLESS_ALLAUTH_TRUSTED_PROXY_COUNT (#13281)

4 days agoTweak: adjust top navbar wrapping when AI chat button visible (#13280)
shamoon [Sat, 25 Jul 2026 06:50:10 +0000 (23:50 -0700)] 
Tweak: adjust top navbar wrapping when AI chat button visible (#13280)

4 days agoMerge branch 'main' into dev
shamoon [Sat, 25 Jul 2026 02:08:23 +0000 (19:08 -0700)] 
Merge branch 'main' into dev

4 days agoFix: preserve document fields during Gotenberg conversion (#13271)
Trenton H [Fri, 24 Jul 2026 20:59:51 +0000 (13:59 -0700)] 
Fix: preserve document fields during Gotenberg conversion (#13271)

Gotenberg's LibreOffice route enables updateIndexes by default, which refreshes dynamic fields (e.g. auto-dates) to the current date. Disable it so field values are preserved as authored.

5 days agoDocumentation: Add the NumPy CPU baseline increase to the migration guide (#13269)
Trenton H [Fri, 24 Jul 2026 16:18:07 +0000 (09:18 -0700)] 
Documentation: Add the NumPy CPU baseline increase to the migration guide (#13269)

5 days agoFix: Makes the email date aware as soon as possible during parsing (#13266)
Trenton H [Fri, 24 Jul 2026 15:39:25 +0000 (08:39 -0700)] 
Fix: Makes the email date aware as soon as possible during parsing (#13266)

5 days agoFix: Handle a plain string as Celery sometimes provides for the traceback (#13267)
Trenton H [Fri, 24 Jul 2026 15:27:57 +0000 (08:27 -0700)] 
Fix: Handle a plain string as Celery sometimes provides for the traceback (#13267)

5 days agoFix: Emit the torch index into the requirements.txt for people still using it (#13265)
Trenton H [Fri, 24 Jul 2026 15:07:52 +0000 (08:07 -0700)] 
Fix: Emit the torch index into the requirements.txt for people still using it (#13265)

5 days agoFix: handle notes without a user when building the search index (#13260)
Matthias Mast [Fri, 24 Jul 2026 13:39:11 +0000 (15:39 +0200)] 
Fix: handle notes without a user when building the search index (#13260)

5 days agoChangelog v3.0.2 - GHA (#13244)
github-actions[bot] [Fri, 24 Jul 2026 01:56:06 +0000 (18:56 -0700)] 
Changelog v3.0.2 - GHA (#13244)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
5 days agoMerge branch 'dev'
shamoon [Fri, 24 Jul 2026 01:13:49 +0000 (18:13 -0700)] 
Merge branch 'dev'

5 days agoBump version to 3.0.2 v3.0.2
shamoon [Fri, 24 Jul 2026 01:12:59 +0000 (18:12 -0700)] 
Bump version to 3.0.2

5 days agoChangelog v3.0.1 - GHA (#13240)
github-actions[bot] [Fri, 24 Jul 2026 00:59:34 +0000 (17:59 -0700)] 
Changelog v3.0.1 - GHA (#13240)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
5 days agoFix: fix broken migration in 3.0.1 (#13242)
shamoon [Fri, 24 Jul 2026 00:59:03 +0000 (17:59 -0700)] 
Fix: fix broken migration in 3.0.1 (#13242)

5 days agoBumps the version to 3.0.1 everywhere v3.0.1
stumpylog [Thu, 23 Jul 2026 22:59:53 +0000 (15:59 -0700)] 
Bumps the version to 3.0.1 everywhere

5 days agoMerge remote-tracking branch 'origin/dev'
stumpylog [Thu, 23 Jul 2026 22:55:41 +0000 (15:55 -0700)] 
Merge remote-tracking branch 'origin/dev'

5 days agoNew Crowdin translations by GitHub Action (#13207)
github-actions[bot] [Thu, 23 Jul 2026 22:54:05 +0000 (15:54 -0700)] 
New Crowdin translations by GitHub Action (#13207)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
5 days agoChore(deps-dev): Bump postcss (#13236)
dependabot[bot] [Thu, 23 Jul 2026 20:21:15 +0000 (20:21 +0000)] 
Chore(deps-dev): Bump postcss (#13236)

Bumps the npm_and_yarn group with 1 update in the /src/paperless_mail/templates directory: [postcss](https://github.com/postcss/postcss).

Updates `postcss` from 8.5.6 to 8.5.22
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.6...8.5.22)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.22
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 19:22:48 +0000 (19:22 +0000)] 
Auto translate strings

6 days agoFix: selection_data re-derives the filtered document set 5 times over (#13229)
Trenton H [Thu, 23 Jul 2026 19:21:20 +0000 (12:21 -0700)] 
Fix: selection_data re-derives the filtered document set 5 times over (#13229)

* Fix: selection_data re-derives the filtered document set 5 times over

_get_selection_data_for_queryset() (powers ?include_selection_data=true on
the document list and search endpoints) computed document_count for
Correspondent/DocumentType/StoragePath/Tag/CustomField by embedding the
caller's full filtered queryset -- filters plus the permission check -- as
a subquery inside 5 separate Count(filter=Q(documents__in=queryset), ...)
calls. Each one re-evaluates that whole queryset from scratch.

Resolve the document ids once into a concrete list and reuse it across all
five annotations instead. For Tag/CustomField specifically (M2M via a
through-model table), also route through annotate_document_count_by_ids()
-- extracted from the tag/custom-field document_count fix (#13203) -- to
avoid the same Count(filter=Q(id__in=...), distinct=True)-on-an-M2M-relation
anti-pattern diagnosed there.

On a 400k-document/1,000-tag corpus, the correspondents portion alone
previously didn't finish within several minutes (killed twice while
investigating, including one run that left a zombie query still consuming
a CPU 30+ minutes later). All five queries together now complete in
~30-35s. Root-caused from a real report (paperless-ngx#13201) via a
different, already-fixed query (#13205) -- this one hasn't been reported
in the wild yet, found by auditing the same call path.

Depends on #13203 for annotate_document_count_by_ids().

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* Address review feedback: drop unnecessary ordering before collecting ids

queryset passed into _get_selection_data_for_queryset() carries the
default/user-specified ordering, which is irrelevant once we're only
collecting a flat id list. Clearing it removes a pointless sort.

No measurable change in benchmarking at 400k documents -- the id-list
materialization/IN-clause cost still dominates -- but it's a free,
strictly-correct cleanup, not just noise-neutral in the other direction.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 18:43:46 +0000 (18:43 +0000)] 
Auto translate strings

6 days agoChore: reword "Settings > Default permissions" description for clarity (#13232)
Nota Inutilis [Thu, 23 Jul 2026 18:41:26 +0000 (20:41 +0200)] 
Chore: reword "Settings > Default permissions" description for clarity (#13232)

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
6 days agoChore(deps): Bump pyasn1 in the uv group across 1 directory (#13237)
dependabot[bot] [Thu, 23 Jul 2026 18:26:56 +0000 (18:26 +0000)] 
Chore(deps): Bump pyasn1 in the uv group across 1 directory (#13237)

Bumps the uv group with 1 update in the / directory: [pyasn1](https://github.com/pyasn1/pyasn1).

Updates `pyasn1` from 0.6.3 to 0.6.4
- [Release notes](https://github.com/pyasn1/pyasn1/releases)
- [Changelog](https://github.com/pyasn1/pyasn1/blob/main/CHANGES.rst)
- [Commits](https://github.com/pyasn1/pyasn1/compare/v0.6.3...v0.6.4)

---
updated-dependencies:
- dependency-name: pyasn1
  dependency-version: 0.6.4
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6 days agoChore(deps): Bump the uv group across 1 directory with 8 updates (#13189)
dependabot[bot] [Thu, 23 Jul 2026 17:58:06 +0000 (17:58 +0000)] 
Chore(deps): Bump the uv group across 1 directory with 8 updates (#13189)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.14.1
  dependency-type: indirect
- dependency-name: cryptography
  dependency-version: 48.0.1
  dependency-type: indirect
- dependency-name: pi-heif
  dependency-version: 1.3.0
  dependency-type: indirect
- dependency-name: pillow
  dependency-version: 12.3.0
  dependency-type: indirect
- dependency-name: pyjwt
  dependency-version: 2.13.0
  dependency-type: indirect
- dependency-name: setuptools
  dependency-version: 83.0.0
  dependency-type: indirect
- dependency-name: torch
  dependency-version: 2.13.0
  dependency-type: direct:production
- dependency-name: tornado
  dependency-version: 6.5.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6 days agoFix: exclude the source document from its own RAG similarity results (#13233)
Trenton H [Thu, 23 Jul 2026 17:25:30 +0000 (10:25 -0700)] 
Fix: exclude the source document from its own RAG similarity results (#13233)

query_similar_documents() never excluded the querying document itself, so a document could appear in its own "similar documents" context, duplicating its content into the AI-suggestions prompt and inflating prompt size/tokens  unnecessarily. Add NE filter support to the vector store and exclude the source document's id at query time.

6 days agoFix (#13214): split mailrule maximum_age clamp into its own migration (#13231)
Trenton H [Thu, 23 Jul 2026 17:09:28 +0000 (10:09 -0700)] 
Fix (#13214): split mailrule maximum_age clamp into its own migration (#13231)

Avoids a Postgres error where the clamp UPDATE and the following ALTER TABLE on paperless_mail_mailrule share a transaction, but the table's FKs are deferrable, so pending trigger events block the ALTER.

Also fixes a verbose_name mismatch in migration 0013.

6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 16:54:02 +0000 (16:54 +0000)] 
Auto translate strings

6 days agoChore: mark yes in confirm button for translation (#13225)
shamoon [Thu, 23 Jul 2026 16:52:04 +0000 (09:52 -0700)] 
Chore: mark yes in confirm button for translation (#13225)

6 days agoFix: correct URL for W001 check (#13220)
shamoon [Thu, 23 Jul 2026 16:39:00 +0000 (09:39 -0700)] 
Fix: correct URL for W001 check (#13220)

6 days agoFix: ensure create dialog uses correct attribute type (#13221)
shamoon [Thu, 23 Jul 2026 16:22:27 +0000 (09:22 -0700)] 
Fix: ensure create dialog uses correct attribute type (#13221)

6 days agoFix: correct database engine from postgres to postgresql in the Porttainer Compose...
Fabian [Thu, 23 Jul 2026 14:40:39 +0000 (16:40 +0200)] 
Fix: correct database engine from postgres to postgresql in the Porttainer Compose file (#13213)

6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 14:24:56 +0000 (14:24 +0000)] 
Auto translate strings

6 days agoFix (beta): remove unnecessary .distinct() dominating document list queries (#13205)
Trenton H [Thu, 23 Jul 2026 14:22:46 +0000 (07:22 -0700)] 
Fix (beta): remove unnecessary .distinct() dominating document list queries (#13205)

DocumentViewSet.get_queryset() carried a blanket .distinct() left over from
an older query shape (predating the version-file feature and the
correlated-subquery rewrite of num_notes/effective_content). Nothing in the
current base queryset can produce duplicate document rows: select_related
is all FK-to-PK, and the permission filter is a boolean id__in predicate,
not a join. id (the PK) is also always selected and inherently unique, so
.distinct() was a structural no-op for correctness.

It was not a no-op for cost. EXPLAIN showed it forcing a full sort-then-
dedupe over the entire permission-visible document set before LIMIT could
apply -- 340k rows for a 25-row page, with the effective_content/num_notes
correlated subqueries re-executed once per row as a result. This was the
dominant cost behind the original report's document overview slowness,
well beyond the get_user_can_change N+1 fixed separately.

Removing it isn't safe on its own, though -- auditing found two existing
filters that rely on an M2M join *without* deduping themselves, previously
papered over by the blanket .distinct():
- InboxFilter: a document with two tags both flagged is_inbox_tag=True
  (nothing prevents that) would be returned twice for ?is_in_inbox=true.
- CustomFieldsFilter: a document with multiple custom field instances
  matching different OR-ed branches would be returned once per match.

Fixed both locally, matching the pattern ObjectFilter already used for
tags__id__in/custom_fields__id__in. Added regression tests for both --
confirmed they fail without the local .distinct() calls.

Benchmarked against the same 400k-document/1,000-tag corpus: document list
wall-clock for a permission-restricted user drops from ~15.8s to ~2.25s
(~7x), closing most of the previous gap to a superuser's ~1.8s.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
6 days agoDocumentation: correct search docs for v3
shamoon [Thu, 23 Jul 2026 13:25:33 +0000 (06:25 -0700)] 
Documentation: correct search docs for v3

6 days agoFix: also wrap non-breaking words in chat messages, handle whitespace (#13211)
shamoon [Thu, 23 Jul 2026 05:25:19 +0000 (22:25 -0700)] 
Fix: also wrap non-breaking words in chat messages, handle whitespace (#13211)

6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 04:30:13 +0000 (04:30 +0000)] 
Auto translate strings

6 days agoFix: tag/custom-field document_count scales badly with tag count (#13203)
Trenton H [Thu, 23 Jul 2026 04:28:49 +0000 (21:28 -0700)] 
Fix: tag/custom-field document_count scales badly with tag count (#13203)

* Fix (beta): tag/custom-field document_count scales badly with tag count

TagViewSet and CustomFieldViewSet's document_count annotation used a
per-row correlated subquery (annotate_document_count_for_related_queryset),
executed once per tag/custom-field row. Fine at a few dozen rows, but at
~1,000 tags it degrades to a full per-tag GroupAggregate over the tags M2M
table -- 6s+ in production reports, confirmed via EXPLAIN (loops=1000).

Replaced with a single, independent GROUP BY over the through table
(permission filter expressed as a plain WHERE, not an aggregate FILTER),
then injected via Case/When. Also tried a more "obvious" fix -- a plain
Count(filter=Q(id__in=permitted_ids), distinct=True) directly on the M2M
relation -- but that's worse: Postgres fails to plan the id__in check as a
semi-join once a large M2M bridge table is involved, and instead re-checks
subquery membership once per joined row.

Benchmarked against a synthetic corpus (400k documents, 1,000 tags @ ~5/doc,
matching real-world reports in discussion #13161): tag list wall-clock drops
from ~180s to ~8s for a permission-restricted user, ~21s to ~8s for a
superuser. No measurable change at typical home-instance scale (tens of
tags).

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* Address review feedback: restore validation, scope aggregation to queryset

- Restore the document_count_source_field validation helper dropped during
  the refactor -- misconfiguring a viewset (document_count_through set
  without document_count_source_field) now fails fast with a clear error
  again instead of an obscure runtime failure.
- Restrict annotate_document_count_for_related_queryset()'s through-table
  aggregation to rows whose related_object_field is one of the annotated
  queryset's pks. No-op for the main tag-list call site (queryset is all
  tags), but avoids unnecessary work for narrower callers like the tag
  descendants branch in TagViewSet.list().

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 04:04:23 +0000 (04:04 +0000)] 
Auto translate strings

6 days agoFix: batch document user_can_change checks to avoid per-row N+1 (#13204)
Trenton H [Thu, 23 Jul 2026 04:02:46 +0000 (21:02 -0700)] 
Fix: batch document user_can_change checks to avoid per-row N+1 (#13204)

* Fix (beta): batch document user_can_change checks to avoid per-row N+1

DocumentSerializer.get_user_can_change() built a fresh
ObjectPermissionChecker and issued a guardian permission-table query for
every document row not owned by the requesting user -- correct, but O(N)
per page load for any non-superuser viewing documents owned by others.

BulkPermissionMixin already batches this exact lookup (2 queries total,
regardless of page size) for Correspondent/Tag/DocumentType/CustomField,
but was gated behind the rarely-used `full_perms` flag and DocumentViewSet
didn't inherit it at all. Changed the gate to "any list action" (cheap:
just two extra queries per page) and added BulkPermissionMixin to
DocumentViewSet, then updated get_user_can_change to consult that batched
context before falling back to a fresh guardian check.

Preserves guardian's own superuser shortcut explicitly (has_perm() special-
cases is_superuser without a query; the batched-context path doesn't, so it
needed its own check) -- covered by a new regression test, since no
existing test exercised a superuser viewing an other-owned document.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* Fix (beta): don't batch permissions for tantivy search results

UnifiedSearchViewSet.list() returns SearchHit/dict-like objects for
text/title/query/more_like_id search requests, not Document ORM instances.
Adding BulkPermissionMixin to DocumentViewSet (previous commit) meant its
get_serializer_context() ran for search responses too, and its
_get_object_perms() -- which expects real model instances with .pk --
crashed on the dict-like hits with AttributeError, turning every search
request into a 400.

Skip the batching specifically for search requests (existing
_is_search_request() check) by calling past BulkPermissionMixin in the
MRO; non-search list() calls (which return a real Document queryset) are
unaffected and still get the batching.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
6 days agoAuto translate strings
GitHub Actions [Thu, 23 Jul 2026 01:55:12 +0000 (01:55 +0000)] 
Auto translate strings

6 days agoFix: fix app title restoration (#13208)
shamoon [Thu, 23 Jul 2026 01:53:45 +0000 (18:53 -0700)] 
Fix: fix app title restoration (#13208)

6 days agoFix: handle long wrapping titles in AI chat document list (#13206)
shamoon [Wed, 22 Jul 2026 23:15:14 +0000 (16:15 -0700)] 
Fix: handle long wrapping titles in AI chat document list (#13206)

6 days agoDocumentation: Add v3.0.0 changelog (#13199)
github-actions[bot] [Wed, 22 Jul 2026 20:05:33 +0000 (13:05 -0700)] 
Documentation: Add v3.0.0 changelog (#13199)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
Co-authored-by: stumpylog <797416+stumpylog@users.noreply.github.com>
7 days agoDocumentation: fix a couple broken links
shamoon [Wed, 22 Jul 2026 18:37:56 +0000 (11:37 -0700)] 
Documentation: fix a couple broken links

7 days agoDocumentation: fix v3 migration guide header level
shamoon [Wed, 22 Jul 2026 18:31:15 +0000 (11:31 -0700)] 
Documentation: fix v3 migration guide header level

7 days ago[Beta] Paperless-ngx v3.0.0 Beta (#12713) v3.0.0
shamoon [Wed, 22 Jul 2026 17:55:13 +0000 (10:55 -0700)] 
[Beta] Paperless-ngx v3.0.0 Beta (#12713)

7 days agoMerge branch 'main' into beta beta 12713/head
shamoon [Wed, 22 Jul 2026 17:30:57 +0000 (10:30 -0700)] 
Merge branch 'main' into beta

7 days agoNew Crowdin translations by GitHub Action (#13153)
github-actions[bot] [Wed, 22 Jul 2026 17:30:33 +0000 (10:30 -0700)] 
New Crowdin translations by GitHub Action (#13153)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
7 days agoAuto translate strings
GitHub Actions [Wed, 22 Jul 2026 17:18:01 +0000 (17:18 +0000)] 
Auto translate strings

7 days agoMerge branch 'beta' into dev
shamoon [Wed, 22 Jul 2026 17:16:33 +0000 (10:16 -0700)] 
Merge branch 'beta' into dev

7 days agoChore (beta): mark first batch of thumbnails as priorty for LCP warning (#13196)
shamoon [Wed, 22 Jul 2026 17:15:56 +0000 (10:15 -0700)] 
Chore (beta): mark first batch of thumbnails as priorty for LCP warning (#13196)

7 days agoFix (beta): prevent pdfjs offsetParent warning (#13197)
shamoon [Wed, 22 Jul 2026 17:06:41 +0000 (10:06 -0700)] 
Fix (beta): prevent pdfjs offsetParent warning (#13197)

7 days agoChore: remove unused import
shamoon [Wed, 22 Jul 2026 16:23:18 +0000 (09:23 -0700)] 
Chore: remove unused import

7 days agoAuto translate strings
GitHub Actions [Wed, 22 Jul 2026 15:45:25 +0000 (15:45 +0000)] 
Auto translate strings

7 days agoFix (beta): dont include hidden buttons in virtual scroll container height (#13194)
shamoon [Wed, 22 Jul 2026 15:42:31 +0000 (08:42 -0700)] 
Fix (beta): dont include hidden buttons in virtual scroll container height (#13194)

7 days agoTweakhancement: allow some bulk operations with all (#13193)
shamoon [Wed, 22 Jul 2026 15:28:49 +0000 (08:28 -0700)] 
Tweakhancement: allow some bulk operations with all (#13193)

7 days agoFix (beta): fix custom field bulk editing for 'all' (#13191)
shamoon [Wed, 22 Jul 2026 15:14:53 +0000 (08:14 -0700)] 
Fix (beta): fix custom field bulk editing for 'all' (#13191)

7 days agoSecurity (beta): enforce current permissions in autocomplete (#13188)
shamoon [Wed, 22 Jul 2026 15:07:43 +0000 (08:07 -0700)] 
Security (beta): enforce current permissions in autocomplete (#13188)

Co-authored-by: stumpylog <797416+stumpylog@users.noreply.github.com>
7 days agoSecurity (beta): bound email linkification (#13187)
shamoon [Wed, 22 Jul 2026 14:41:12 +0000 (07:41 -0700)] 
Security (beta): bound email linkification (#13187)