openems icon indicating copy to clipboard operation
openems copied to clipboard

Fix: Preserve currentEdge and channel subscriptions when navigating to /user to prevent data loss on return to /live page.

Open Jasonlee6789 opened this issue 6 months ago • 1 comments

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 Image After chrome-capture-2025-6-19

Operating System

MacOS

How to reproduce the Error?

  1. Use OpenEMS UI version 2025.4.0 or later.
  2. Navigate to /device/[edgeId]/live and observe data correctly displayed.
  3. Navigate to the /user page.
  4. Click the back button.
  5. Observe:
    • Data on the Live page appears momentarily.
    • Then disappears and only "-" placeholders are shown.

Jasonlee6789 avatar Jun 20 '25 02:06 Jasonlee6789

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.

codecov[bot] avatar Jun 20 '25 02:06 codecov[bot]

This PR has been automatically marked as stale due to inactivity. It will be closed in 7 days if no further activity occurs.

github-actions[bot] avatar Sep 16 '25 02:09 github-actions[bot]

Closing this PR due to inactivity.

github-actions[bot] avatar Sep 23 '25 02:09 github-actions[bot]