fix(statuses): remove WS workarounds - part 2#2512
Conversation
|
Qovery can create a Preview Environment for this PR.
This comment has been generated from Qovery AI 🤖.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #2512 +/- ##
===========================================
- Coverage 47.30% 47.08% -0.23%
===========================================
Files 1274 1231 -43
Lines 23705 23062 -643
Branches 6991 6857 -134
===========================================
- Hits 11214 10858 -356
+ Misses 10347 10121 -226
+ Partials 2144 2083 -61
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/qovery preview 28c47145-c8e7-4b9d-8d9e-c65c95b48425 |
|
A preview environment was automatically created via Qovery. Another comment will be posted when deployments are finished |
|
Your preview environment has been successfully deployed ! |
There was a problem hiding this comment.
I've got a feeling we have a regression between prod and the fixes, running status goes from RUNNING -> STOPPED-> RUNNING - you can check the video!
https://www.loom.com/share/66dc0d135f424578bbed7dfbb1caaad6?focus_title=1&muted=1&from_recorder=1
bc89944 to
10584e2
Compare
|
A preview environment was automatically created via Qovery. Another comment will be posted when deployments are finished |
There was a problem hiding this comment.
Pull request overview
Completes the removal of the “WS closed / status unavailable” workaround introduced earlier by deleting the checkRunningStatusClosed query keys/hooks and simplifying status rendering, while adjusting the WebSocket onMessage behavior to reduce unnecessary React Query cache writes.
Changes:
- Removed
checkRunningStatusClosedquery keys and feature hooks from services/environments domains. - Updated services/environments UI components to stop rendering the “Status unavailable” fallback based on the removed workaround.
- Updated
useStatusWebSocketsto only write React Query cache when statuses change, and removed theonClosehandler.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/shared/util-web-sockets/src/lib/use-status-web-sockets/use-status-web-sockets.ts | Removes WS close workaround and adds “only update on change” cache writes for env/service statuses. |
| libs/domains/services/feature/src/lib/service-list/service-list.tsx | Removes UI + hook usage for the “status unavailable” workaround in the service list. |
| libs/domains/services/feature/src/lib/hooks/use-check-running-status-closed/use-check-running-status-closed.ts | Deletes the now-unused hook. |
| libs/domains/services/data-access/src/lib/domains-services-data-access.ts | Removes the checkRunningStatusClosed query key from services query factory. |
| libs/domains/environments/feature/src/lib/hooks/use-check-running-status-closed/use-check-running-status-closed.ts | Deletes the now-unused hook. |
| libs/domains/environments/feature/src/lib/environment-state-chip/environment-state-chip.tsx | Removes workaround logic that forced STOPPED when WS was “unavailable”. |
| libs/domains/environments/feature/src/lib/environment-list/environment-list.tsx | Removes “status unavailable” fallback UI from environment list. |
| libs/domains/environments/data-access/src/lib/domains-environments-data-access.ts | Removes the checkRunningStatusClosed query key from environments query factory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
libs/shared/util-web-sockets/src/lib/use-status-web-sockets/use-status-web-sockets.ts
Outdated
Show resolved
Hide resolved
libs/shared/util-web-sockets/src/lib/use-status-web-sockets/use-status-web-sockets.ts
Show resolved
Hide resolved
… in useStatusWebSockets Agent-Logs-Url: https://github.com/Qovery/console/sessions/0f5de3f9-43a6-4026-baaf-d53f9796dcfa Co-authored-by: rmnbrd <426749+rmnbrd@users.noreply.github.com>
|
/qovery preview 28c47145-c8e7-4b9d-8d9e-c65c95b48425 |
|
A preview environment was automatically created via Qovery. Another comment will be posted when deployments are finished |
…iggered_action Agent-Logs-Url: https://github.com/Qovery/console/sessions/9256eaa7-86d6-4661-974e-b86def54ba11 Co-authored-by: rmnbrd <426749+rmnbrd@users.noreply.github.com>
|
Your preview environment failed to be deployed ! |
Summary
Issue: QOV-1727
This PR finishes what #2510 started:
checkRunningStatusClosedqueries and associated hooks.onMessagecallback of theuseStatusWebSocketshook to prevent the queries' data from being reset or updated unnecessarily.onClosecallback from theuseStatusWebSocketshook.JSON.stringifychange detection withfast-deep-equalfor both environment and service running status comparisons inuseStatusWebSockets, avoiding repeated serialization on every WS message and eliminating sensitivity to property-order differences.triggered_actionfrom the WS payload to the environment running status cache (it was previously dropped, causing consumers to always seetriggered_action: undefined).Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.