Bug 380209 - Speed labels and speed graph empty after showing the applet twice
Summary: Speed labels and speed graph empty after showing the applet twice
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: DataEngines (show other bugs)
Version: 5.8.7
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 356841 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-05-25 22:22 UTC by Elvis Angelaccio
Modified: 2017-06-21 22:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.8.8, 5.10.1


Attachments
Empty speed graph (76.43 KB, image/png)
2017-05-25 22:23 UTC, Elvis Angelaccio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elvis Angelaccio 2017-05-25 22:22:11 UTC
To reproduce:

1. Run "plasmoidviewer -a org.kde.plasma.networkmanagement"
2. Show the applet, the speed labels (upload/download) are on the right of the "Connected" label, as expected. The graph with the upload/download curves also works fine.
3. Close the applet
4. Open the applet again, the speed labels are gone and the graph stays empty.

When expanding the connection item to show the graph, I get this output: 

file:///usr/share/plasma/plasmoids/org.kde.plasma.networkmanagement/contents/ui/ConnectionItem.qml:193:26: Unable to assign [undefined] to bool
file:///usr/share/plasma/plasmoids/org.kde.plasma.networkmanagement/contents/ui/ConnectionItem.qml:193:26: Unable to assign [undefined] to bool

I can reproduce this issue on two different machines connected to the same Wi-Fi network.
Comment 1 Elvis Angelaccio 2017-05-25 22:23:17 UTC
Created attachment 105717 [details]
Empty speed graph

Screenshot of the empty speed graph after the bug occurs.
Comment 2 Elvis Angelaccio 2017-05-26 07:52:38 UTC
(In reply to Elvis Angelaccio from comment #0)
> When expanding the connection item to show the graph, I get this output: 
> 
> file:///usr/share/plasma/plasmoids/org.kde.plasma.networkmanagement/contents/
> ui/ConnectionItem.qml:193:26: Unable to assign [undefined] to bool
> file:///usr/share/plasma/plasmoids/org.kde.plasma.networkmanagement/contents/
> ui/ConnectionItem.qml:193:26: Unable to assign [undefined] to bool

Further debug prints show that:

qml: dataSource.data[dataSource.downloadSource]: undefined
qml: dataSource.data[dataSource.uploadSource]: undefined
Comment 3 Elvis Angelaccio 2017-05-26 08:27:18 UTC
hmm this looks like a bug in the systemmonitor data engine. I have a patch that seems to fix it.
Comment 4 Jan Grulich 2017-05-26 09:59:54 UTC
Thank you!! Close this bug please once your patch is upstreamed.
Comment 5 Elvis Angelaccio 2017-05-26 10:20:54 UTC
Git commit f060ad5f1ad06359088887cb2f7e691c994ccfc5 by Elvis Angelaccio.
Committed on 26/05/2017 at 09:25.
Pushed by elvisangelaccio into branch 'Plasma/5.8'.

Always add data sources in SystemMonitorEngine::sourceRequestEvent()

Summary:
Otherwise if we show the plasma-nm applet twice, m_sensors won't be empty
and we won't be able to fect the connection speed data.

git blame points to
https://github.com/KDE/kde-workspace/commit/ba7444f99ab08cf0a305899bf66879314bd0d5a9
and
https://github.com/KDE/kde-workspace/commit/235fea1868b560acf32c5c13a3d16ef233b50be6

but they don't really explain why setData() was called only if m_sensors
was empty.

Test Plan:
- plasmoidviewer -a org.kde.plasma.networkmanagement
- open the networkmanager applet twice
- make sure the connection's speed graph works the 2nd time.

Reviewers: #plasma, jgrulich

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5973

M  +2    -12   dataengines/systemmonitor/systemmonitor.cpp

https://commits.kde.org/plasma-workspace/f060ad5f1ad06359088887cb2f7e691c994ccfc5
Comment 6 Christoph Feck 2017-06-20 02:06:40 UTC
Jan, is bug 356841 a duplicate?
Comment 7 Jan Grulich 2017-06-20 06:26:47 UTC
Possibly. You can close it as a duplicate and if it's not, then the reporter can re-open it after he tries fixed plasma-workspace.
Comment 8 Elvis Angelaccio 2017-06-20 07:16:20 UTC
Yeah it's the same bug. Sorry I didn't know there was already a report.
Comment 9 Elvis Angelaccio 2017-06-20 07:16:30 UTC
*** Bug 356841 has been marked as a duplicate of this bug. ***