Bug 363028 - Updater shows one update too many
Summary: Updater shows one update too many
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Updates (other bugs)
Version First Reported In: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-13 14:44 UTC by Sven Claussner
Modified: 2016-06-21 15:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Discover showing Update (2) but only one update. (22.68 KB, image/png)
2016-06-17 22:01 UTC, skierpage
Details
console output running Discover (3.49 KB, text/plain)
2016-06-17 22:07 UTC, skierpage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Claussner 2016-05-13 14:44:06 UTC
The updater shows 1 update more than the actual update count.

Reproducible: Always

Steps to Reproduce:
1. Open Discoverer
2. Check the 'Updates' toolbar item.

Actual Results:  
If no update is available, then it reads 'Updates (1)'.
If updates are available, it reads one more update than the actual number.

Expected Results:  
The number of updates in the 'Updates' toolbox item is identical to the real number of pending updates. 

Running latest Debian testing with KDE Plasma version 5.4.3, Qt 5.5.1.
Comment 1 Aleix Pol 2016-05-19 15:18:19 UTC
I cannot reproduce. Do you know which backends you're using?
Please tell me the output of: plasma --listbackends
Comment 2 skierpage 2016-06-17 22:01:31 UTC
Created attachment 99556 [details]
Discover showing Update (2) but only one update.

This happened to me, see screenshot. I'm running Discover 5.6.4 on KDE Frameworks 5.22.0 & QT 5.5.1 from the KDE backport PPA on Kubuntu 16.04. After an update I ran `/usr/bin/plasma-discover --mode update` and its header shows "Update (2)" while there is only one System Update. The pop-up for the plasma panel also says "1 package to update". I'll attach the output.
Comment 3 skierpage 2016-06-17 22:07:15 UTC
Created attachment 99557 [details]
console output running Discover

This is the console output from Discover when I took attachment 99556 [details].
Note the "KNewStuff3" output, is that obsolete?  I've upgraded my Kubuntu installation in-place 10 times (every release since 9.04).
Comment 4 skierpage 2016-06-17 22:18:36 UTC
(In reply to Aleix Pol from comment #1)
> I cannot reproduce. Do you know which backends you're using?
> Please tell me the output of: plasma --listbackends

I don't have a `plasma` binary, `/usr/bin/plasma-discover --listbackends` outputs
Available backends:
 * knscomics-backend
 * knsplasmoids-backend
 * qapt-backend

I notice that I also have a plasma-discover-updater binary with a different appearance, its -v option outputs "plasmadiscoverupdater 5.6.4". plasma-discover is the binary that runs when I click [update] in the Plasma panel's update notification pop-up, its -v option outputs "muondiscover 5.6.4"
Comment 5 Aleix Pol 2016-06-21 15:54:42 UTC
Git commit 918c310c27e583a15d7cdb40535b5ae6230b4481 by Aleix Pol.
Committed on 21/06/2016 at 15:54.
Pushed by apol into branch 'Plasma/5.7'.

Make sure the list of updateable packages is updated when the state changes

Solves an off-by-one issue when the signal was emitted too early, before
the package was removed.

M  +10   -2    libdiscover/resources/StandardBackendUpdater.cpp
M  +1    -0    libdiscover/resources/StandardBackendUpdater.h

http://commits.kde.org/discover/918c310c27e583a15d7cdb40535b5ae6230b4481