Bug 338216

Summary: When trying to send a report I receive a 410 error (not logged in)
Product: [Applications] drkonqi Reporter: Cristian OneČ› <onet.cristian>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: alpeterson, kdelibs-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.17.0
Sentry Crash Report:
Attachments: Screenshot of the last page

Description Cristian OneČ› 2014-08-12 11:10:42 UTC
Created attachment 88231 [details]
Screenshot of the last page

I was trying to report a Konsole crash. I went trough the kcrash wizard (one of them was authentication) but when I got to the point of sending the report I got this error that stated that I can't send it because I'm not logged in.

This might be a bug (the session is lost) but the least I would expect is that if this error is received I'm allowed to login again.
Comment 1 Harald Sitter 2019-07-03 12:23:57 UTC
*** Bug 338728 has been marked as a duplicate of this bug. ***
Comment 2 Harald Sitter 2019-07-05 14:50:39 UTC
Git commit 824efbe6aa174a5a4426c93b514c5b8c1e0669ef by Harald Sitter.
Committed on 05/07/2019 at 14:49.
Pushed by sitter into branch 'master'.

force a token refresh before submitting the report

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.
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

Reviewers: apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

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

M  +14   -2    src/bugzillaintegration/bugzillalib.cpp
M  +1    -0    src/bugzillaintegration/bugzillalib.h
M  +22   -1    src/bugzillaintegration/reportassistantpages_bugzilla.cpp
M  +3    -1    src/bugzillaintegration/reportinterface.h

https://commits.kde.org/drkonqi/824efbe6aa174a5a4426c93b514c5b8c1e0669ef