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

Ensure device logs always shown #4893

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Ensure device logs always shown #4893

merged 3 commits into from
Dec 11, 2024

Conversation

hardillb
Copy link
Contributor

@hardillb hardillb commented Dec 9, 2024

fixes #4832

Description

This triggers a publish of the logs history every time the tab is opened. It does this by explicitly telling the device agent it has disconnected when navigating away from the tab.

Related Issue(s)

#4832

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

fixes #4832

This triggers a publish of the logs history every time the tab
is opened
@hardillb hardillb requested review from knolleary and cstns December 9, 2024 14:16
@hardillb hardillb self-assigned this Dec 9, 2024
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 78.70%. Comparing base (b545283) to head (d5e59ad).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
forge/comms/commsClient.js 0.00% 5 Missing ⚠️
forge/comms/devices.js 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4893      +/-   ##
==========================================
- Coverage   78.74%   78.70%   -0.04%     
==========================================
  Files         323      323              
  Lines       15221    15230       +9     
  Branches     3496     3498       +2     
==========================================
+ Hits        11986    11987       +1     
- Misses       3235     3243       +8     
Flag Coverage Δ
backend 78.70% <10.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@cstns cstns left a comment

Choose a reason for hiding this comment

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

running fine locally

@cstns cstns merged commit a7ebfe3 into main Dec 11, 2024
17 of 18 checks passed
@cstns cstns deleted the show-device-log-history branch December 11, 2024 14:29
@knolleary
Copy link
Member

This PR has broken the logs when you have more than one user access them. By triggering an unsubscribe when leaving the page, it stops log delivery to other users viewing the device. When you open the device log view it triggers the buffer to be resent and is received by all users viewing the log.

This needs to be reverted.

@hardillb
Copy link
Contributor Author

hardillb commented Dec 13, 2024

I believe this was already the case with the old way as well.

Actually no, but it relied on a race between the keep alive and the log shutdown

@cstns
Copy link
Contributor

cstns commented Dec 13, 2024

could we namespace the events to target a single user?

@hardillb
Copy link
Contributor Author

The quick revert is to remove the publish from the unmounted while we look again

@knolleary knolleary mentioned this pull request Dec 13, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device logs show no history when navigating back to the logs page
3 participants