force a token refresh before submitting the report
ClosedPublic

Authored by sitter on Jul 5 2019, 10:50 AM.

Details

Summary

when the user takes a very long time to prepare the bug report the original
login session may have timed out and prevent submitting the bug report.
as a super simple way to prevent this let's simply force a refresh.
we need to do a query to check validity anyway, so we might as well
force a refresh and get a new token right away.

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

BUG: 338216
FIXED-IN: 5.17.0
CHANGELOG: Login tokens get refreshed before submitting reports to prevent unauthorized errors

Test Plan
  • file bug without any interruption all goody
  • add Bugzilla::connection().setToken(QString()); to simulate the token having gone invalid -> continues to work
  • disconnect network before submit causes a network unreachable login error -> connect again -> retry -> submission succeeds

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jul 5 2019, 10:50 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 5 2019, 10:50 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sitter requested review of this revision.Jul 5 2019, 10:50 AM
apol requested changes to this revision.Jul 5 2019, 11:20 AM
This revision now requires changes to proceed.Jul 5 2019, 11:20 AM
apol accepted this revision.Jul 5 2019, 11:20 AM
This revision is now accepted and ready to land.Jul 5 2019, 11:20 AM
This revision was automatically updated to reflect the committed changes.