ErrorOverlay: don't show by mistake if called with Running twice.
ClosedPublic

Authored by dfaure on Dec 8 2017, 11:03 PM.

Details

Summary

If serverStateChanged(Running) is called twice, the first time
this would hide the overlay and set mOverlayActive=false,
so the second time this goes into the else branch, which
shows the overlay...

The reason it's called twice isn't because ServerManager
emits stateChanged(Running) twice, obviously (it only emits on actual
change). The reason is that the ErrorOverlay constructor calls
serverStateChanged(state) and connects to &ServerManager::stateChanged.
It can happen that for this initial state, ServerManager::state() finds
out "Running" before ServerManager gets a chance to notice by itself
and emit stateChanged().

BUG: 379997

Test Plan

Found with debug output, during session startup,
over many weeks (it's clearly a race condition).

Diff Detail

Repository
R165 Akonadi
Branch
erroroverlay
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Dec 8 2017, 11:03 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptDec 8 2017, 11:03 PM
dfaure requested review of this revision.Dec 8 2017, 11:03 PM
dvratil accepted this revision.Dec 9 2017, 11:09 AM

Thanks!

This revision is now accepted and ready to land.Dec 9 2017, 11:09 AM
dfaure closed this revision.Dec 9 2017, 8:58 PM