Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the sessions polling to the server and notify using the websocket channel #2016

Closed
lorenzo-cavazzi opened this issue Aug 30, 2022 · 1 comment · Fixed by #2145
Closed
Assignees
Labels
ui-server Issue on the ui-server component
Milestone

Comments

@lorenzo-cavazzi
Copy link
Member

Motivation

As a follow-up to #1338, we should stop looping for the sessions in the UI client and move the logic to the UI server.

Plan

This is broadly how this should work:

SERVER

  • Query sessions in the short loop, hash the whole content, and store it locally (we might want to remove data we expect to change often like resources usage and timestamps, or we might even just take a slice of the whole response as far as it detects all the relevant changes)
  • Compare the hashed content to verify whether something changed. If that's the case, store the new content and send a "sessions changed" notification to the client.

CLIENT

  • When getting a "sessions changed" notification, refretch the sessions when relevant . This might either be always or depending on the current page (i.e. relevant when look at any project page or any session page).

INFO
A stub of the code is already available here https://github.com/SwissDataScienceCenter/renku-ui/blob/master/server/src/websocket/handlers/sessions.ts
Please mind that this was made for a previous POC and the logic has changed a bit in the meanwhile (E.G. we might not want "session-id" or "storage" anymore, we can cache on the channel data property; we also want to notify all the channels directly from the function).

@lorenzo-cavazzi lorenzo-cavazzi added the ui-server Issue on the ui-server component label Aug 30, 2022
@ciyer ciyer modified the milestones: 2.8.0-next-next, 2.8.0-next Sep 21, 2022
@ciyer ciyer modified the milestones: 2.10.0, 2.10.0-next Oct 7, 2022
@lokijuhy lokijuhy moved this to Todo in MIX Feature Team Oct 10, 2022
@ciyer ciyer modified the milestones: 2.10.0-next, 2.10.0-next-next Nov 2, 2022
@ciyer ciyer moved this to Todo in UI Sprints - DEPRECATED Nov 2, 2022
@lorenzo-cavazzi lorenzo-cavazzi moved this from Todo to Ungroomed 🪵 in UI Sprints - DEPRECATED Nov 11, 2022
@lorenzo-cavazzi
Copy link
Member Author

We should start with a first POC using the sessions notifications to re-fetch content only when we are not in a session page.

  • The client asks for sessions at startup
  • The server keeps sending information
  • The client refetch sessions unless:
    • we are visualizing a session page
    • sessions are being fetched or were already refreshed lass than 3 seconds ago.

@lorenzo-cavazzi lorenzo-cavazzi moved this from On hold 🛑 to Todo in UI Sprints - DEPRECATED Nov 11, 2022
@andre-code andre-code self-assigned this Nov 15, 2022
@andre-code andre-code moved this from Todo to In Progress 🧑‍💻 in UI Sprints - DEPRECATED Nov 15, 2022
@andre-code andre-code moved this from In Progress 🧑‍💻 to Review 🔎 in UI Sprints - DEPRECATED Nov 26, 2022
@andre-code andre-code moved this from Review 🔎 to In Progress 🧑‍💻 in UI Sprints - DEPRECATED Nov 29, 2022
@andre-code andre-code moved this from In Progress 🧑‍💻 to Review 🔎 in UI Sprints - DEPRECATED Nov 29, 2022
@andre-code andre-code moved this from Review 🔎 to In Progress 🧑‍💻 in UI Sprints - DEPRECATED Dec 2, 2022
@andre-code andre-code moved this from In Progress 🧑‍💻 to Review 🔎 in UI Sprints - DEPRECATED Dec 5, 2022
Repository owner moved this from Todo to Done in MIX Feature Team Dec 6, 2022
Repository owner moved this from Review 🔎 to Done ✅ in UI Sprints - DEPRECATED Dec 6, 2022
Repository owner moved this from Review 🔎 to Done ✅ in UI Sprints - DEPRECATED Dec 6, 2022
Repository owner moved this from Todo to Done in MIX Feature Team Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui-server Issue on the ui-server component
Projects
No open projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants