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
Feat/websocket running status FRT-390 #120
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 71f5331. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
A preview environment was automatically created via Qovery. |
937bcf3
to
175a72b
Compare
storeDatabasesRunningStatus(message) | ||
} | ||
} | ||
}, [dispatch, lastMessage, appsLoadingStatus, dbsLoadingStatus, envsLoadingStatus, clusterId]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, eslint says that environmentsAssociatedToCluster
is missing from the dependencies. It works very well without it. But as soon as you add it in the dependencies, you get an infinite loop. I tried many different things.
The easiest solution would be to be able to read the env slice from within the useEffect but I can't use useSelector inside a useEffect. I don't know what I do wrong here and it's pretty hard to formulate the issue to Google. I tried for hours...
342d159
to
3574c3a
Compare
6173e76
to
71f5331
Compare
🎉 This PR is included in version 1.0.0-staging.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What does this PR do?
Adding websocket running status feature to show all the chip with correct color and running status
> Link to the JIRA ticket
List of things done and complex due to the way these websockets work:
z23oiuio0
) and long uuid. Ids of app / database / environment may vary between the websocket message and their id given by the rest API. The rest API will always send our entities with their uuid. In the websocket, sometimes we have a short version of the id and this version begins with a z. We had to create a utility to match the short and long one.todo:
bugs:
This has been resolved by adding in the websocket component in the useEffect dependency array, the
applicationLoadingStatus === 'loaded'
,dbsLoadingStatus === loaded
etc...With that, as soon as we have a loaded status, we replay the useEffect populating, this time, entities that are stored in the slices. Hurray. => Other bug, right now, with the one-to-many relationship, we don't set back the loadingStatus to unloaded. Once we have successfully loaded one collection, the loadingStatus stays forever on loaded... We'll have to address that later.
PR Checklist
Global
Store
NX
feature
,ui
,data
,utils
Clean Code