Commit Graph
193 Commits
Author SHA1 Message Date
aed9abe48c Feature: Replace Whoosh with tantivy search backend (#12471)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Antoine Mérino <3023499+Merinorus@users.noreply.github.com>
2026-04-02 12:38:22 -07:00
701735f6e5 Chore: Drop old signal and unneeded apps, transition to parser registry instead (#12405)
* refactor: switch consumer and callers to ParserRegistry (Phase 4)

Replace all Django signal-based parser discovery with direct registry
calls. Removes `_parser_cleanup`, `parser_is_new_style` shims, and all
old-style isinstance checks. All parser instantiation now uses the
`with parser_class() as parser:` context manager pattern.

- documents/parsers.py: delegate to get_parser_registry(); drop lru_cache
- documents/consumer.py: use registry + context manager; remove shims
- documents/tasks.py: same pattern
- documents/management/commands/document_thumbnails.py: same pattern
- documents/views.py: get_metadata uses context manager
- documents/checks.py: use get_parser_registry().all_parsers()
- paperless/parsers/registry.py: add all_parsers() public method
- tests: update mocks to target documents.consumer.get_parser_class_for_mime_type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: drop get_parser_class_for_mime_type; callers use registry directly

All callers now call get_parser_registry().get_parser_for_file() with
the actual filename and path, enabling score() to use file extension
hints. The MIME-only helper is removed.

- consumer.py: passes self.filename + self.working_copy
- tasks.py: passes document.original_filename + document.source_path
- document_thumbnails.py: same pattern
- views.py: passes Path(file).name + Path(file)
- parsers.py: internal helpers inline the registry call with filename=""
- test_parsers.py: drop TestParserDiscovery (was testing mock behavior);
  TestParserAvailability uses registry directly
- test_consumer.py: mocks switch to documents.consumer.get_parser_registry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove document_consumer_declaration signal infrastructure

Remove the document_consumer_declaration signal that was previously used
for parser registration. Each parser app no longer connects to this signal,
and the signal declaration itself has been removed from documents/signals.

Changes:
- Remove document_consumer_declaration from documents/signals/__init__.py
- Remove ready() methods and signal imports from all parser app configs
- Delete signal shim files (signals.py) from all parser apps:
  - paperless_tesseract/signals.py
  - paperless_text/signals.py
  - paperless_tika/signals.py
  - paperless_mail/signals.py
  - paperless_remote/signals.py

Parser discovery now happens exclusively through the ParserRegistry
system introduced in the previous refactor phases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove empty paperless_text and paperless_tika Django apps

After parser classes were moved to paperless/parsers/ in the plugin
refactor, these Django apps contained only empty AppConfig classes
with no models, views, tasks, migrations, or other functionality.

- Remove paperless_text and paperless_tika from INSTALLED_APPS
- Delete empty app directories entirely
- Update pyproject.toml test exclusions
- Clean stale mypy baseline entries for moved parser files

paperless_remote app is retained as it contains meaningful system
checks for Azure AI configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Moves the checks and tests to the main application and removes the old applications

* Adds a comment to satisy Sonar

* refactor: remove automatic log_summary() call from get_parser_registry()

The summary was logged once per process, causing it to appear repeatedly
during Docker startup (management commands, web server, each Celery
worker subprocess). External parsers are already announced individually
at INFO when discovered; the full summary is redundant noise.
log_summary() is retained on ParserRegistry for manual/debug use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Cleans up the duplicate test file/fixture

* Fixes a race condition where webserver threads could race to populate the registry

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 06:53:32 -07:00
shamoon 0f84af27d0 Merge branch 'main' into dev
# Conflicts:
#	docs/setup.md
#	src-ui/src/main.ts
#	src/documents/tests/test_api_bulk_edit.py
#	src/documents/tests/test_api_custom_fields.py
#	src/documents/tests/test_api_search.py
#	src/documents/tests/test_api_status.py
#	src/documents/tests/test_workflows.py
#	src/paperless_mail/tests/test_api.py
2026-03-21 02:12:19 -07:00
0f7c02de5e Fix: test: add regression test for workflow save clobbering filename (#12390)
Add test_workflow_document_updated_does_not_overwrite_filename to
verify that run_workflows (DOCUMENT_UPDATED path) does not revert a
DB filename that was updated by a concurrent bulk_update_documents
task's update_filename_and_move_files call.

The test replicates the race window by:
  - Updating the DB filename directly (simulating BUD-1 completing)
  - Mocking refresh_from_db so the stale in-memory filename persists
  - Asserting the DB filename is not clobbered after run_workflows

Relates to: https://github.com/paperless-ngx/paperless-ngx/issues/12386

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 13:31:09 -07:00
shamoonandGitHub b6501b0c47 Fix: avoid moving files if already moved (#12389) 2026-03-18 09:51:48 -07:00
shamoon 48cd1cce6a Merge branch 'main' into dev 2026-03-15 18:50:42 -07:00
shamoonandGitHub 60319c6d37 Fix: prevent stale db filename during workflow actions (#12289) 2026-03-09 19:32:46 -07:00
shamoonandGitHub df03207eef Fix: correct doc version filename handling (#12223) 2026-03-04 23:28:07 +00:00
shamoon d51a118aac Merge branch 'main' into dev 2026-03-04 13:31:20 -08:00
shamoonandGitHub 299dac21ee Enhancement: “live” document updates (#12141) 2026-03-04 00:27:07 +00:00
shamoonandGitHub 8b8307571a Fix: enforce path limit for db filename fields (#12235) 2026-03-03 13:19:56 -08:00
Trenton HandGitHub 43406f44f2 Feature: Improve the retagger output using rich (#12194) 2026-03-03 07:14:59 -08:00
shamoonandGitHub 96ac7b2336 Tweak: Ignore version docs for workflows (#12217) 2026-03-02 08:21:14 -08:00
shamoonandGitHub ceee769e26 Feature: document file versions (#12061) 2026-02-26 16:46:54 +00:00
c4ea332c61 Feature: move to trash action for workflows (#11176)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-02-23 16:42:50 -08:00
Trenton HandGitHub 6a87c3f4dd Fixes handling the case where there is no status reported from celery (due to external termination of the worker) (#12040) 2026-02-08 17:26:35 -08:00
shamoonandGitHub e45fca475a Feature: password removal workflow action (#11665) 2026-02-03 17:10:07 +00:00
Sebastian SteinbeißerandGitHub 3b5ffbf9fa Chore(mypy): Annotate None returns for typing improvements (#11213) 2026-02-02 08:44:12 -08:00
shamoonandTrenton H 742c136773 Fix: use explicit order field for workflow actions (#11781) 2026-01-16 07:39:00 -08:00
shamoonandGitHub 055ce9172c Fix: use explicit order field for workflow actions (#11781) 2026-01-15 22:49:21 +00:00
shamoon 9c0de249a6 Merge branch 'main' into dev 2026-01-13 11:53:40 -08:00
shamoon 7c457466b7 Security: prevent path traversal in storage paths 2026-01-13 09:29:48 -08:00
shamoonandGitHub e940764fe0 Feature: Paperless AI (#10319) 2026-01-13 16:24:42 +00:00
shamoonandGitHub 3b4d958b97 Performance: avoid unnecessary filename operations on bulk custom field updates (#11558) 2025-12-12 07:50:51 -08:00
shamoonandGitHub 66d363bdc5 Chore: refactor workflows code (#11563) 2025-12-11 12:13:10 -08:00
shamoonandGitHub 0c43b50f01 Fix: change async handling of select custom field updates (#11490) 2025-11-30 03:54:15 +00:00
shamoonandGitHub cf5ac596ed Performance: make move files after select custom field change async (#11391) 2025-11-19 15:21:33 +00:00
shamoon b3d6359afc Chore: set signal receivers with weak=False 2025-11-17 10:02:32 -08:00
c5ad148dc7 Fix: include BASE_URL when constructing doc_url for workflows (#11360)
---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2025-11-14 17:45:13 +00:00
shamoonandGitHub b12f1e757c Fixhancement: refactor email attachment logic (#11336) 2025-11-14 17:28:46 +00:00
shamoonandGitHub a9dfe8f3f7 Fix: use original_file when attaching docs to workflow emails with added trigger (#11266) 2025-11-03 08:42:29 -08:00
Jan KleineandGitHub 340754d865 Enhancement: use friendly file names when emailing documents (#11055) 2025-10-15 17:10:25 +00:00
f0d1c75fac Feature: add support for emailing multiple documents (#10666)
---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2025-10-13 13:16:43 -07:00
4cff907ba0 Feature: Nested Tags (#10833)
---------

Co-authored-by: Trenton H <797416+stumpylog@users.noreply.github.com>
2025-09-17 21:41:39 +00:00
shamoonandGitHub 6730896894 Enhancement: support webhook restrictions (#10555) 2025-08-11 10:15:30 -07:00
Sebastian SteinbeißerandGitHub 6dca4daea5 Chore: switch from os.path to pathlib.Path (#10397) 2025-08-06 10:50:42 -07:00
0ea159683d Performance: add setting to enable DB connection pooling for PostgreSQL (#10354)
---------

Co-authored-by: Trenton H <797416+stumpylog@users.noreply.github.com>
2025-08-02 12:54:13 +00:00
shamoonandGitHub f214440d2e Fix: correct PAPERLESS_EMPTY_TRASH_DIR to Path (#10227) 2025-06-19 11:50:23 -07:00
shamoonandGitHub 60ebdc0ad6 Fix: use hard delete for custom fields with workflow removal (#10191) 2025-06-16 07:09:22 -07:00
shamoonandGitHub 15b1b83c66 Chore/fix: cleanup user or group references in settings upon deletion (#10049) 2025-05-29 19:05:48 +00:00
shamoonandGitHub 1a6f32534c Change: treat created as date not datetime (#9793) 2025-05-16 14:23:04 +00:00
shamoonandGitHub a57a3dbb30 Fix: do not try deleting original that was moved to trash dir (#9684) 2025-04-19 15:11:29 -07:00
shamoonandGitHub df5af5c8ad Fix: correctly handle dict data with webhook (#9674) 2025-04-16 00:07:08 -07:00
shamoonandGitHub b9f7428f2f Fix: include matching check for scheduled workflows (#9594) 2025-04-09 02:12:42 -07:00
shamoonandGitHub 358db10fe3 Fix: ensure only matched scheduled workflows are applied (#9580) 2025-04-08 08:55:03 -07:00
shamoonandGitHub a8de26f88a Fix: only overwrite existing cf values in workflow if set (#9459) 2025-03-23 17:25:15 -07:00
shamoonandGitHub 7146a5f4fc Fix: use correct filename with webhook (#9392) 2025-03-14 07:44:40 -07:00
shamoonandGitHub edc7181843 Enhancement: support assigning custom field values in workflows (#9272) 2025-03-05 12:30:19 -08:00
Trenton HandGitHub 817aad7c8b Fix: Switches data to content to upload raw bytes/text content (#9293) 2025-03-04 18:56:28 +00:00
shamoonandGitHub 16f17829b6 Fix: handle null workflow body and email subject (#9271) 2025-03-01 15:44:52 -08:00