Zum Inhalt

In per-user ownership, the parts of a split upload get no owner from the app, and a document of the account that a user's upload may have made waits for its owner

  • Status: accepted
  • Date: 2026-11-30
  • Amends 0571: no record follows the parts of an upload that Paperless splits by its barcodes; a note of an upload catches the documents of the account whose original name may be its name, and a row holds them until someone in Paperless gives them their owner

Context

In per-user ownership, Paperless makes the account of the app the owner of every upload, and the app gives the document its user's owner by one of two proofs (0571): the task of the upload names the document, or a record without a task finds a document of the account with the checksum of the whole file and a higher ID. A document of the account that no proof ties to an upload goes to the target user, who gets the documents of the account.

When Paperless splits an upload by its barcodes, the task of the upload names no document, and no part has the checksum of the whole file. Since 1.10.6 the app followed the tasks of the parts instead: a record for each part, which gave each part's document the user of the upload. The app finds those tasks only while it can read the task of the upload and its list of tasks, and while Paperless names its account. Each release from 1.10.7 to 1.10.11 closed another case in which this following went wrong, and a look at the code for 1.10.11 still found cases in which the parts of a user's split upload went to the target user: an answer of the upload that never came, a further upload of the file after that, a task of the upload or of a part that Paperless no longer lists, a split that fails after Paperless queued a part, and a Paperless that doesn't name its account. In each, the parts became documents of the account like any other, and once nothing held the documents of the account, the target user got them.

What every part has, whether or not the app can read a task: Paperless gives the document of each part the original name of the uploaded file (PostDocumentView, which the contract tests check on both lines of Paperless-ngx, also for a part of a part).

Options

  1. Follow the parts better again. Each release did that, and each look found another case, as the app depends on tasks that Paperless may drop, on an answer that may get lost and on the ID of the account.
  2. Hold the documents of the account for 30 days after every upload. It holds every document of the account, also those of the consume folder or a mail rule, and after 30 days the parts would go to the target user all the same.
  3. No part gets an owner from the app. The parts stay with the account, and every document of the account that a user's upload may have made, by its original name, waits until someone in Paperless gives it its owner. It costs an admin's step for every split upload, and a document of the account that has the same name by chance waits too.

Decision

Option 3, in three rules:

  1. An owner comes only from one upload, by one of the two proofs of 0571. The task of the upload names the document, or a record without a task finds a document of the account with the checksum of the whole file and a higher ID. No other document of the account gets an owner from the app, and no part ever does: a split ends the record of the upload, and the report of its user names the split (UploadSettlement). A dry-run reports the same and ends nothing.
  2. A document of the account that a user's upload may have made waits until someone in Paperless gives it an owner (WaitingDocuments). A note of an upload (0571, UploadNotes) of a user whose user of Paperless isn't the account names a document of the account when the note's name may be what Paperless made of the original name of the document, compared on the safe side by the letters and digits alone (UploadNotes::mayName()); a document without an original name counts as named. The original name keeps the whole name, unlike the name of the file and the task, which Paperless cuts at 255 bytes, so the cut hides no document from its note. The scheduled run that first catches such a document writes a row for it and each user whose note names it, with the time of that run, and names it in the report of each of them as an error. From then on the row holds it, whatever the notes say, until Paperless names another owner for it, also none, or a scheduled run whose lists are complete no longer lists it; every later run names the waiting documents of each user in one notice, DOCUMENTS WAITING, so that a hold doesn't make every run fail. The note only decides what is caught; it doesn't decide how long it waits. The hold comes before the tags and the viewers of a document, so a waiting document goes to no one. A document that the hold of the uploads holds already, while an upload waits, gets no row and no line, and neither does a document in the run of one document of the webhook, which holds what the notes and rows hold and leaves the rows and the lines to the next scheduled run. A row of a user whom Nextcloud deleted stays, and the report of the run names it.
  3. Without the ID of the account, the export waits. While a note of such a user is open or a row exists and Paperless doesn't name its account, the export waits with the line of 0571, which now names a document of the account as well.

The target user keeps their purpose: the documents without an owner, such as those of the consume folder, and the documents that reached the account in other ways, such as a mail rule of the account or another client with its token, still go to them. To send a waiting document to the target user on purpose, an admin removes its owner in Paperless.

This replaces the bullets A split by barcodes and The names of the notes of 0571, and its sentence that the 30 days end the record so that nothing waits for good: a record still ends after 30 days, but a document that a note caught waits by its row, also for good when nobody gives it its owner.

The update to this version ends the records that 1.10.6 to 1.10.11 made for parts (Version000250Date20261130120000): every open record with a task that no note names by its task, which is every record of a part, as no note names the task of a part, and the record of an upload of 1.10.5, which has no note. Each record that goes, and each open record without a task, leaves a note of its user with the name of its file and its start, unless the user has a note of that name, so that the next run catches their documents by rule 2. A record whose task a note names, such as a split that a run held, stays, and its next run ends it with the line of the split. An unsplit upload of 1.10.5 whose task Paperless still queues at the update loses its record, and gets its owner from the pending import of the inbox or the pending send.

Consequences

A part reaches a user's archive only once someone in Paperless gives it its owner, whether the app could read a task or not, and whatever was lost on the way.

The price, in plain words: in per-user ownership, every upload that Paperless splits ends with documents that wait until an admin gives them their owner. A document of the account of the same name that was never the user's waits as well, also one that Paperless had before the upload, and nothing releases it on its own. A waiting document also goes to no user with tags who would get it by a tag. Each one is named once as an error and then in a notice of every run.

The limits that stay, which the documents name:

  • A part that Paperless consumes only after the note of its upload has ended, after 30 days in its queue, or after its user was deleted with their notes, is caught by no note, and goes to the target user as a document of the account.
  • Copies of parts that 1.10.6 to 1.10.11 already exported to the target user stay in that archive until someone gives the parts their owner in Paperless.
  • On Paperless-ngx 3.x, a document of the account with the bytes of the file and a higher ID still goes to the record's user for 30 days, as 0571 says.

The code that only the following of parts used went with this change, as the checks of the project refuse code that no test runs and code that nothing calls: the claims of the notes, the windows of time around a split, the names and times that the list of tasks gave of other uploads, UploadNotes::mayStem(), UploadNotes::fileName() and the comparison of the name of a part's record. The columns of the records of the parts, held_at, split_name and part_name, keep their defaults and can go with a migration of their own; the migration of this change stays, as every update from 1.10.6 to 1.10.11 needs it.

Addendum: a note ends only after a run that held what it catches

A note holds a document only while the note exists, and only a scheduled run that writes a row makes the hold outlast the note. In 1.10.12, a note ended 30 days after its upload whether or not such a run had come, and the trash of Paperless counted for neither the notes nor the rows, so a waiting document could still reach the target user: once its note had ended while the export waited without the ID of the account, while an upload held the documents of the account, while the export or scheduled synchronization was off or no run came, or while Paperless listed the document without its owner, and once it came back from the trash after its note had ended. Two rules close that:

  1. In per-user ownership, a note ends only after a scheduled run that held with a row every document of the account that it catches. UploadNotes::end() runs after the export of SyncService::syncUsers(), in a run that is no dry-run, whose lists of the documents and of the trash are complete, in which no waiting upload held the documents of the account, and which listed no document without its owner field whose name a note may give, as that run can't hold such a document with a row (WaitingDocuments::sure()). The run of one document of the webhook ends no note, and neither does a round of Send to Paperless in per-user ownership. Single ownership ends its notes at the start of each run and in each round of Send to Paperless, as before.
  2. The trash of Paperless counts like its documents. WaitingDocuments::hold() takes the trash that the scheduled run reads already: a document of the account in the trash that a note catches gets its row and its line, a row stays while its document is in the trash, and a row ends only once a complete scheduled run lists its document neither among the documents nor in the trash. No document of the trash goes anywhere: the run only holds it.

The price, in plain words: in per-user ownership, the notes stay while no such run comes, as while the export or scheduled synchronization is off, while an upload waits, while the lists are never complete, or while Paperless doesn't name its account; without View for UI Settings, the export then waits until the account has it, also after 30 days. A note costs one row of the database for as long as it stays, and the first run of rule 1 after its 30 days ends it.

The first of the limits above stays, and the pages name it now: a part that Paperless consumes only after the note of its upload has ended, more than 30 days after the upload, or after its user was deleted with their notes, is caught by no note and goes to the target user as a document of the account.