Skip to content

Conversation

@sanderegg
Copy link
Member

@sanderegg sanderegg commented Jun 24, 2025

What do these changes do?

This PR ensures that re-connection of a user to the websocket re-enables the flow of log/progress messages to the frontend.

Related issue/s

How to test

Dev-ops

@sanderegg sanderegg added this to the Engage milestone Jun 24, 2025
@sanderegg sanderegg self-assigned this Jun 24, 2025
@sanderegg sanderegg added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jun 24, 2025
@sanderegg sanderegg marked this pull request as ready for review June 24, 2025 15:16
@sanderegg sanderegg added the 🤖-automerge marks PR as ready to be merged for Mergify label Jun 24, 2025
@sanderegg
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jun 24, 2025

queue

🟠 Waiting for conditions to match

  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • any of: [🛡 GitHub branch protection]
        • check-neutral = integration-tests
        • check-skipped = integration-tests
        • check-success = integration-tests
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that when a user’s WebSocket connection is restored, their log/progress queue resumes by passing and handling a client_session_id across socket handlers and observers.

  • Extended the auth handler to return a client_session_id.
  • Updated connect flow to emit client_session_id with the user-connected signal.
  • Added new observers in project slot and adjusted resource-usage handlers to accept client_session_id.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
services/web/server/src/simcore_service_webserver/socketio/_handlers.py Extended auth handler return type and emit arguments
services/web/server/src/simcore_service_webserver/resource_usage/_observer.py Updated observer signatures to accept client_session_id
services/web/server/src/simcore_service_webserver/projects/_controller/projects_slot.py Added user-connected observer that uses client_session_id
Comments suppressed due to low confidence (3)

services/web/server/src/simcore_service_webserver/socketio/_handlers.py:47

  • [nitpick] The docstring for this handler should be updated to mention that a client_session_id is now returned in addition to user_id and product_name.
    async def _handler(request: web.Request) -> tuple[UserID, ProductName, str]:

services/web/server/src/simcore_service_webserver/projects/_controller/projects_slot.py:24

  • [nitpick] Consider adding a docstring to explain this new observer’s purpose and the meaning of its parameters, especially client_session_id.
async def _on_user_connected(

services/web/server/src/simcore_service_webserver/socketio/_handlers.py:139

  • Add or update unit/integration tests to cover reconnect scenarios and verify that client_session_id is correctly propagated and used for restoring log/progress queues.
        )

@codecov
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.23%. Comparing base (bfb683d) to head (57d30a3).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (bfb683d) and HEAD (57d30a3). Click for more details.

HEAD has 30 uploads less than BASE
Flag BASE (bfb683d) HEAD (57d30a3)
unittests 33 4
integrationtests 6 5
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7971      +/-   ##
==========================================
- Coverage   87.89%   81.23%   -6.66%     
==========================================
  Files        1841      692    -1149     
  Lines       70996    32726   -38270     
  Branches     1227      176    -1051     
==========================================
- Hits        62401    26585   -35816     
+ Misses       8241     6083    -2158     
+ Partials      354       58     -296     
Flag Coverage Δ
integrationtests 60.50% <75.00%> (-3.77%) ⬇️
unittests 86.89% <100.00%> (+0.40%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 76.92% <ø> (-8.13%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 60.21% <ø> (-30.91%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 88.33% <ø> (-1.77%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 87.72% <100.00%> (+0.09%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bfb683d...57d30a3. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

Merci!

@sanderegg sanderegg force-pushed the bugfix/ensure-rabbitmq-connection-ha branch from 84d53cc to 378c79e Compare June 24, 2025 16:09
@sanderegg
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jun 24, 2025

queue

🟠 Waiting for conditions to match

  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed

@sanderegg sanderegg force-pushed the bugfix/ensure-rabbitmq-connection-ha branch from 378c79e to 0572ef4 Compare June 24, 2025 17:08
Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@sanderegg sanderegg force-pushed the bugfix/ensure-rabbitmq-connection-ha branch from 0572ef4 to 57d30a3 Compare June 25, 2025 20:34
@sanderegg
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jun 25, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 4546aa7

@sonarqubecloud
Copy link

@mergify mergify bot merged commit 4546aa7 into ITISFoundation:master Jun 25, 2025
95 of 98 checks passed
@sanderegg sanderegg deleted the bugfix/ensure-rabbitmq-connection-ha branch June 25, 2025 21:27
@pcrespov pcrespov mentioned this pull request Jul 2, 2025
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When a replica of the webserver restarts, then all the RabbitMQ subscriptions are lost

5 participants