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

Connect backend and frontend to signalR #1041

Merged
merged 18 commits into from
Nov 7, 2023
Merged

Conversation

andchiind
Copy link
Contributor

@andchiind andchiind commented Oct 4, 2023

Closes #1020 #1063

This PR connects the frontend and backend to SignalR, and then replaces polling for missionRuns and failed missions for the mission queue and failed missions banner.

It is important to note that in order to use signalR in a react context, that context provider must be nested within the signalR provider in flotillasite.tsx

@andchiind andchiind force-pushed the 1020-signalR branch 8 times, most recently from c08b2a8 to 4b24872 Compare October 6, 2023 12:39
@andchiind
Copy link
Contributor Author

Currently we have one event that is sent if a mission run is updated in any way. Since this means that an update to a step also implies an update due to a task update, we could potentially create more fine tuned events to avoid unnecessary events in the frontend. So if you are only interested in the status of a mission changing then you could subscribe just to that and ignore step and task updates, for example.

@andchiind andchiind force-pushed the 1020-signalR branch 4 times, most recently from b7151b6 to 0dfa8a4 Compare October 10, 2023 07:34
@andchiind
Copy link
Contributor Author

All frontend polling has been removed except the call to get mission runs within the history page filter. This one could be removed by having the GET request only be made when a "mission run updated/created" event is received which would not be filtered away, but since "mission run updated" is called each time a task is completed, this may create be a small improvement overall, for the price of more complicated code. It may still be worthwhile doing at some point though, especially as it would be satisfying to remove the last reference to "refreshInterval".

@andchiind andchiind force-pushed the 1020-signalR branch 4 times, most recently from 111266f to 0637251 Compare October 11, 2023 11:04
@andchiind andchiind marked this pull request as ready for review October 11, 2023 11:07
@andchiind andchiind force-pushed the 1020-signalR branch 2 times, most recently from 33c3d32 to 6fafb3d Compare October 12, 2023 11:01
@andchiind andchiind self-assigned this Oct 13, 2023
@andchiind andchiind added backend Backend related functionality improvement Improvement to existing functionality frontend Frontend related functionality epic labels Oct 13, 2023
@github-actions
Copy link

🔔 Migrations changes detected 🔔
📣 Remember to comment "/UpdateDatabase" after review approval for migrations to take effect!

@github-actions github-actions bot added the database-change Will require migration label Oct 16, 2023
Copy link
Contributor

@aeshub aeshub left a comment

Choose a reason for hiding this comment

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

LGTM

@andchiind andchiind force-pushed the 1020-signalR branch 4 times, most recently from 27b7f1b to cd05c96 Compare November 7, 2023 11:37
@andchiind
Copy link
Contributor Author

/UpdateDatabase

Copy link

github-actions bot commented Nov 7, 2023

👀 Running migration command... 👀

Copy link

github-actions bot commented Nov 7, 2023

✨ Successfully ran migration command! ✨

@andchiind andchiind merged commit fe4e017 into equinor:main Nov 7, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related functionality database-change Will require migration epic frontend Frontend related functionality improvement Improvement to existing functionality
Projects
None yet
2 participants