<table><tr><td style="">sitter created this revision.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />sitter requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22288">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>when the user takes a very long time to prepare the bug report the original<br />
login session may have timed out and prevent submitting the bug report.<br />
as a super simple way to prevent this let's simply force a refresh.<br />
we need to do a query to check validity anyway, so we might as well<br />
force a refresh and get a new token right away.</p>

<p>this temporarily chains the login interfaces to the report interfaces, upon<br />
successful login the report is sent. if any of the two throws an error<br />
the page goes into error state which offers a retry button to run<br />
aboutToShow again. therefore we also want to disconnect the signal chains<br />
to avoid multiple slot invocations on possible retries.</p>

<p>BUG: 338216<br />
FIXED-IN: 5.17.0<br />
CHANGELOG: Login tokens get refreshed before submitting reports to prevent unauthorized errors</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">file bug without any interruption all goody</li>
<li class="remarkup-list-item">add <tt style="background: #ebebeb; font-size: 13px;">Bugzilla::connection().setToken(QString());</tt> to simulate the token having gone invalid -> continues to work</li>
<li class="remarkup-list-item">disconnect network before submit causes a network unreachable login error -> connect again -> retry -> submission succeeds</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R871 DrKonqi</div></div></div><br /><div><strong>BRANCH</strong><div><div>refresh-token</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22288">https://phabricator.kde.org/D22288</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/bugzillaintegration/bugzillalib.cpp<br />
src/bugzillaintegration/bugzillalib.h<br />
src/bugzillaintegration/reportassistantpages_bugzilla.cpp<br />
src/bugzillaintegration/reportinterface.h</div></div></div><br /><div><strong>To: </strong>sitter<br /><strong>Cc: </strong>plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>