Repository navigation
fix(api): run one privacy export per account at a time - #1007
Open
Medformatik wants to merge 2 commits into
Open
Medformatik wants to merge 2 commits into
Medformatik wants to merge 2 commits into
Conversation
Medformatik
force-pushed
the
fix/privacy-export-admission
branch
from
November 16, 2026 10:00
a23a70d to
14f9fa8
Compare
Any number of exports for one account could be prepared and streamed at once. An account now holds one export slot, the process allows four in total, and the route joins the expensive rate-limit class. A retry after an interrupted download is accepted once the earlier attempt has settled.
An export slot was held until the stream settled, with no limit on how long that could take. The download now ends after 60 seconds without the client taking data and after one hour in total, and collecting the managed timeline stops when the client leaves or after 20 minutes.
Medformatik
force-pushed
the
fix/privacy-export-admission
branch
from
November 16, 2026 17:23
14f9fa8 to
7886784
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
The self-service privacy export collects an account's data across the database and connected sources and streams it as an archive. It required a recent sign-in but had no limit on how many exports one account could run at once, and it sat in the broad rate-limit class. One signed-in account could keep many full export preparations running.
An account now holds one export slot at a time, and the API process runs at most four exports in total. A second export for the same account is refused with
409 EXPORT_IN_PROGRESSbefore anything is recorded; at the process limit the answer is503 PRIVACY_SERVICE_UNAVAILABLE. The slot is released after a finished download, a failed preparation and an interrupted stream, and only once the outcome has been recorded, so retrying an interrupted download works as before. The route also moves to the expensive rate-limit class. The web app shows a specific message for both refusals.If the client leaves while the export is still being prepared, the archive stream now ends at once. A download also ends after 60 seconds in which the client takes no data and after one hour in total, so a slow or stalled reader cannot keep a slot; the administrator-led download uses the same stream and gets the same limits. Collecting the managed timeline stops when the client leaves or after 20 minutes. Collecting from the OpenMapX database has no deadline of its own yet.
The slots live in the API process, like the other rate limits; with several replicas each one counts its own. The administrator-led export is unchanged: each of those needs a one-time re-authentication.
Related work
Eighth layer of the stack that starts with #983.
Verification
check-typespasses forapps/api,packages/coreandapps/web; Biome, Prettier,check-translationsandcheck-openapipass.Release and upgrade impact
No operator action and no migration.
No package release: the extension CLI is counted through shared core and translation sources, but it uses neither the privacy error codes nor the strings added here.