mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-26 13:54:56 +00:00
The document overview sent include_selection_data=true on every list request (page/filter/sort change), computing 5 correlated Count(DISTINCT) aggregations over the full matching queryset inline before the list could render. At scale (hundreds of thousands of documents, unfiltered) this is the confirmed root cause of the document overview "eternally loading" in paperless-ngx/paperless-ngx#13161. Split the aggregation into its own endpoint, GET /api/documents/filter_selection_data/, filter-scoped the same way the list endpoint already resolves matches (no document ID enumeration needed). The frontend now fetches it as a separate, non-blocking request after the list has already rendered, for plain (non-search) browsing. Full-text search keeps computing it inline since results are already narrowed by the search backend first. include_selection_data never shipped in a stable release (introduced this beta cycle, not present on main), so the plain list endpoint simply stops acting on it rather than needing a deprecation path. Also closes a latent localStorage leak between document-list-view.service.spec.ts tests (filterRules persisted via localStorage were never cleared, only sessionStorage was) that this change's new URL-dependent follow-up request exposed, and fixes two tests that were unknowingly relying on that leaked state to pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PaperlessUi
This project was generated with Angular CLI version 10.1.5.
Development server
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Code scaffolding
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Build
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --configuration production flag for a production build.
Running unit tests
Run ng test to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e to execute the end-to-end tests via Protractor.
Further help
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.