From 64200a7f23e146571a104bdcd04ffe8e642ec541 Mon Sep 17 00:00:00 2001 From: arc53-machine <232052973+arc53-machine@users.noreply.github.com> Date: Tue, 22 Sep 2026 10:52:55 +0100 Subject: [PATCH] docs(admin): say what the export cap header actually reports The comment claimed X-Export-Max-Rows says whether the cap was reached; it reports the cap that was in effect, which is what lets a caller tell a truncated export from a complete one. --- docsgpt/api/admin/activity.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docsgpt/api/admin/activity.py b/docsgpt/api/admin/activity.py index f2f7bd1e..0f2d4ae5 100644 --- a/docsgpt/api/admin/activity.py +++ b/docsgpt/api/admin/activity.py @@ -173,8 +173,9 @@ class AdminActivityExportResource(Resource): """Stream the filtered feed as CSV or NDJSON. Streamed, not buffered: a compliance export of a busy instance should - not be built in memory first. Capped at ``_EXPORT_MAX_ROWS``; the - response header says whether the cap was reached. + not be built in memory first. Capped at ``_EXPORT_MAX_ROWS``, and the + ``X-Export-Max-Rows`` header reports the cap that was in effect so a + truncated export is not mistaken for a complete one. """ fmt = (request.args.get("format") or "csv").lower() if fmt not in _EXPORT_FORMATS: @@ -192,8 +193,8 @@ class AdminActivityExportResource(Resource): "Content-Disposition": ( f'attachment; filename="docsgpt-activity-{stamp}.{fmt}"' ), - # Partial content would otherwise be indistinguishable from a - # complete export. + # The cap in effect. Without it a truncated export reads as + # a complete one. "X-Export-Max-Rows": str(limit), "Cache-Control": "no-store", },