Fix: Preserve currentEdge and channel subscriptions when navigating to /user to prevent data loss on return to /live page.
Description
When navigating from the /user page back to the /device/[edgeId]/live page (e.g., by clicking a back button in the header), the data initially appears for a brief moment, but then disappears. This causes the Live page to show "-" placeholders instead of the actual channel data.
When navigating from live page to user page and back, data subscriptions were being lost because EdgeComponent unsubscribed channels during destruction regardless of navigation target.
This fix prevent clearing currentEdge and unsubscribing channels when navigating to /user, as it is not considered exiting Edge context. This fixes the issue where returning to /live would result in missing real-time data due to lost channel subscriptions.
--
Screenshots
Before
After
Operating System
MacOS
How to reproduce the Error?
- Use OpenEMS UI version
2025.4.0or later. - Navigate to
/device/[edgeId]/liveand observe data correctly displayed. - Navigate to the
/userpage. - Click the back button.
- Observe:
- Data on the Live page appears momentarily.
- Then disappears and only
"-"placeholders are shown.
Codecov Report
:x: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
:x: Your patch status has failed because the patch coverage (0.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## develop #3198 +/- ##
=============================================
+ Coverage 58.86% 58.87% +0.01%
Complexity 173 173
=============================================
Files 2619 2619
Lines 113027 113030 +3
Branches 8318 8319 +1
=============================================
+ Hits 66526 66536 +10
+ Misses 44010 44005 -5
+ Partials 2491 2489 -2
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
This PR has been automatically marked as stale due to inactivity. It will be closed in 7 days if no further activity occurs.
Closing this PR due to inactivity.