Skip to content

feat(sequences): add offset query param to detections endpoint#592

Open
ThbltLmr wants to merge 1 commit into
mainfrom
feat/sequences-detections-offset
Open

feat(sequences): add offset query param to detections endpoint#592
ThbltLmr wants to merge 1 commit into
mainfrom
feat/sequences-detections-offset

Conversation

@ThbltLmr
Copy link
Copy Markdown
Collaborator

@ThbltLmr ThbltLmr commented May 14, 2026

Summary

  • Adds an offset query parameter to the GET /sequences/{sequence_id}/detections endpoint, wiring through the existing fetch_all offset support so callers can page through all detections of a sequence.

Test plan

  • New tests in src/tests/endpoints/test_sequences.py cover the offset behavior
  • Verify pagination works end-to-end against a populated sequence

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.15%. Comparing base (3a69b32) to head (b18ab1c).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
+ Coverage   90.11%   90.15%   +0.04%     
==========================================
  Files          55       55              
  Lines        2498     2498              
==========================================
+ Hits         2251     2252       +1     
+ Misses        247      246       -1     
Flag Coverage Δ
backend 90.13% <ø> (+0.04%) ⬆️
client 90.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Wire the existing fetch_all offset support into fetch_sequence_detections
so callers can page through all detections of a sequence.
@ThbltLmr ThbltLmr force-pushed the feat/sequences-detections-offset branch from 0b377d6 to b18ab1c Compare May 14, 2026 14:05
Copy link
Copy Markdown
Member

@fe51 fe51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ThbltLmr,
The kind of update that makes you wonder why we didn’t do it from the start, it feels so natural to add it !

Thanks, Thibault, for sorting it out and adding the necessary tests

if UserRole.ADMIN not in token_payload.scopes and token_payload.organization_id != camera.organization_id:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Access forbidden.")

# Get the bucket of the camera's organization
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the comment deletion ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThbltLmr juste quick question ? But i think we are good to merge after that :)

@fe51 fe51 marked this pull request as ready for review May 25, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants