Skip to content

feat: live image polling on ODLC Images page#77

Open
Michael-R-Dickinson wants to merge 9 commits into
mainfrom
live-images-updates
Open

feat: live image polling on ODLC Images page#77
Michael-R-Dickinson wants to merge 9 commits into
mainfrom
live-images-updates

Conversation

@Michael-R-Dickinson

@Michael-R-Dickinson Michael-R-Dickinson commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an Auto-refresh toggle to the ODLC Images page that polls for new images every second and merges them into the session without reloading existing ones
  • Introduces a lightweight sidecar index file ({session_id}.index.json) per session containing only [{id, receivedAt}] — the poll hot path reads this tiny file instead of the full multi-MB session JSON, keeping CPU load flat as sessions grow
  • Adds GET /vision/odlc-session/{id}/index/?since=<ms> and GET /vision/odlc-session/{id}/records/{record_id}/ endpoints; renames patch_odlc_recordodlc_record to reflect it now handles both GET and PATCH

Test plan

  • Toggle Auto-refresh on — verify new images received via WebRTC appear in the list within ~1 second without clearing existing images or annotations
  • Toggle Auto-refresh off — verify polling stops (no further network requests to the index endpoint)
  • Navigate away from the ODLC Images page with Auto-refresh on — verify the interval is cleared (no background requests)
  • With a large existing session, confirm the poll on "nothing new" only hits the index endpoint (small response), not the full session file
  • Annotate or flag an image while Auto-refresh is on — verify the annotation is not overwritten by an incoming poll
  • Confirm existing session restore on page load still works correctly

Written by michael 👨

@maplesyrup-0606 maplesyrup-0606 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume this is an attempt to reduce the upload speed? If so, how much was reduced, was that measured?

@Michael-R-Dickinson

Copy link
Copy Markdown
Collaborator Author

I assume this is an attempt to reduce the upload speed? If so, how much was reduced, was that measured?

On the macbook we got < 2s from capture button to image showing up on another tab, but this probably isn't representative of how it will perform on the mercpad. We'll test more soon

Sign up for free to 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.

3 participants