Skip to content

Add the Database Reco Counts CSV report endpoint - #3357

Merged
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/issue-3343
Aug 7, 2026
Merged

Add the Database Reco Counts CSV report endpoint#3357
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/issue-3343

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Routes POST /imagetargets/databases/{database_id}/reports/recoCounts on both the in-process and Flask backends, returning a presigned_url which points at a new GET /reports/recoCounts/{report_id} download route that needs no authorization and returns 404 until the report is ready, then 200 with the CSV.

The month field must be a YYYY-mm string naming the current or previous month, and anything else returns Fail; the documentation gives no result code for this endpoint, so that choice and the CSV header row are recorded as unverified in differences-to-vws.rst. The CSV is header-only because the mock does not count recognitions, which is deliberate — real Vuforia's counts lag past the length of a test, as the existing verify_mock_vuforia reco tests assert — so making the report non-empty is proposed separately in #3356. The Flask app cannot recover its external host from the request and so gains a VWS_BASE_URL setting for building the download URL.

Verified fake tests cover a valid request for both months, an out-of-range month and five malformed months, with download behaviour mock-only since real report generation takes up to an hour; all new and touched files are at 100% line and branch coverage.

Closes#3343.

🤖 Generated with Claude Code

Route `POST /imagetargets/databases/{database_id}/reports/recoCounts` on both
the in-process and Flask backends, returning a `presigned_url` pointing at a
new `GET /reports/recoCounts/{report_id}` download route. That route needs no
authorization and returns 404 until the report is ready, then 200 with the CSV.
The `month` field must be a `YYYY-mm` string naming the current or previous
month; anything else returns `Fail`. The CSV is header-only because the mock
does not count recognitions, which is now documented along with the unverified
error behaviour. Making the report non-empty is #3356.
The Flask app cannot recover its external host from the request, so it gains a
`VWS_BASE_URL` setting for building the download URL.
Closes#3343.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Real Vuforia returned 401 for a request signed with valid server keys which
named a random database ID in the path, so the path's database ID appears to
have to belong to the credentials. The test credentials do not include a
database ID, so the request cannot be made against real Vuforia at all.
Run the tests under `mock_only_vuforia` and record in the differences
documentation that nothing about the endpoint is verified.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the Database Reco Counts CSV report endpoint

1 participant

@adamtheturtle