Skip to content

Don't reuse a shared result once the run has moved on - #27

Merged
hyperrealist merged 1 commit into
DiamondLightSource:mainfrom
hyperrealist:fresh-final-poll
Oct 19, 2026
Merged

hyperrealist merged 1 commit into
DiamondLightSource:mainfrom
hyperrealist:fresh-final-poll

Conversation

@hyperrealist

Copy link
Copy Markdown
Contributor

/binned and /render reuse a result for identical requests for 0.5 s, so the poll a UI makes when a scan ends could get the previous poll's result, without the scan's last points. Shared results are now also keyed on the run's progress in the catalog (stop document present, shape of primary/RedTotal), so they are never reused once the run has grown or finished. Concurrent polls of an unchanged run still share one computation.

To test: tests/test_visr.py -k shared_result (fails without the change).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR

/binned and /render reuse a result for identical requests for half a second.
The poll a UI makes when a scan ends could therefore be given the result of
the poll just before, computed without the scan's last points, and nothing
polls after it. Results are now also keyed on how far the run has got, as its
catalog records it: whether it has a stop document, and the shape of its
camera's RedTotal. Concurrent polls of an unchanged run still share one
computation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.56%. Comparing base (2207428) to head (43fd865).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   95.49%   95.56%   +0.06%     
==========================================
  Files           5        5              
  Lines         799      811      +12     
==========================================
+ Hits          763      775      +12     
  Misses         36       36              

☔ View full report in Codecov by Harness.
📢 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.

@hyperrealist
hyperrealist merged commit c3077e5 into DiamondLightSource:main Oct 19, 2026
8 checks passed
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.

1 participant