Skip to content

Record 'last active' time for SPA particle picking and tomo motion correction jobs - #913

Merged
tieneupin merged 8 commits into
mainfrom
add-last-active-column
Oct 12, 2026
Merged

tieneupin merged 8 commits into
mainfrom
add-last-active-column

Conversation

@tieneupin

@tieneupin tieneupin commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

A recent incident involving a user cleaning up a session that was still undergoing processing has highlighted the need for more safeguards to be implemented.

One starting safeguard would be recording when the processing was last registered on the session. When motion_corrected or picked_particles messages are sent back to the Murfey feedback queue, The timestamp of when that job was received will be stored in the Murfey Session table. This information can then be used by the frontend to filter out sessions with ongoing processing if a cleanup/deletion request is sent.

This change also revealed some side effects from the recent SQLAlchemy change (see #910 ). Database queries now require the query parameter types to match. For instance, when running an exec command where DataCollectionGroup.id == message["dcg_id"], the contents of message["dcg_id"] must now be an int).

As part of this PR, all instances of message["session_id"] and message["program_id"] in murfey.server and murfey.workflows were forcibly converted to ints.

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.35%. Comparing base (32938e3) to head (debdfef).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #913      +/-   ##
==========================================
- Coverage   55.50%   55.35%   -0.15%     
==========================================
  Files         103      103              
  Lines       11588    11632      +44     
  Branches     1546     1546              
==========================================
+ Hits         6432     6439       +7     
- Misses       4807     4844      +37     
  Partials      349      349              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tieneupin tieneupin self-assigned this Oct 9, 2026
@tieneupin tieneupin added bug Something isn't working enhancement New feature or request server Relates to the server component labels Oct 9, 2026
@tieneupin
tieneupin marked this pull request as ready for review October 9, 2026 15:56

@stephen-riggs stephen-riggs 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.

Looks good to me. The session ids will already be ints in endpoints coming from the client, but just inting everything does make the most sense

@tieneupin

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing, Stephen. PR ended up becoming more convoluted than expected. In the longer run, as we break the items in feedback_callback out into workflow modules, we could also set up Pydantic models to validate the incoming messages, ensuring that the values are of the correct types by the time they are used in the functions.

@tieneupin
tieneupin merged commit 5d50503 into main Oct 12, 2026
16 checks passed
@tieneupin
tieneupin deleted the add-last-active-column branch October 12, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request server Relates to the server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants