Merge lp:~mardy/webbrowser-app/clear-cookies into lp:webbrowser-app

Proposed by Alberto Mardegan
Status: Merged
Approved by: David Barth
Approved revision: 721
Merged at revision: 736
Proposed branch: lp:~mardy/webbrowser-app/clear-cookies
Merge into: lp:webbrowser-app
Diff against target: 45 lines (+28/-0)
1 file modified
src/app/webcontainer/webapp-container.cpp (+28/-0)
To merge this branch: bzr merge lp:~mardy/webbrowser-app/clear-cookies
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Alexandre Abreu (community) Needs Information
PS Jenkins bot continuous-integration Approve
Review via email: mp+235754@code.launchpad.net

Commit message

Remove all local webapp data when using OA

When the webapp is integrated with OA, remove all the local data on startup. This is a temporary hack to ensure that the webapp always works as expected, even when it has been used with different accounts.
The long-term solution is to use a per-account data directory.

Description of the change

Remove all local webapp data when using OA

When the webapp is integrated with OA, remove all the local data on startup. This is a temporary hack to ensure that the webapp always works as expected, even when it has been used with different accounts.
The long-term solution is to use a per-account data directory.

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :

Can you add a comment in the code with a reference to the bug report and a quick explanation about cookies from different identities which may conflict in a webapp.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:718
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/1099/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/5123/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/3731
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/298
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/298
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/298/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/298
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/4868/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/6375
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/6375/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/13640
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/3121
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4042
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4042/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/1099/rebuild

review: Needs Fixing (continuous-integration)
719. By Alberto Mardegan

Add comment

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:719
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/1100/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/5125/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/3732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/299
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/299
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/299/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/299
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/4870/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/6377
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/6377/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/13642
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/3122
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4043
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4043/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/1100/rebuild

review: Needs Fixing (continuous-integration)
720. By Alberto Mardegan

Only for google

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
721. By Alberto Mardegan

Add command line option

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) :
review: Needs Information
Revision history for this message
Alexandre Abreu (abreu-alexandre) :
Revision history for this message
David Barth (dbarth) :
Revision history for this message
David Barth (dbarth) wrote :

inline replies

Revision history for this message
Alexandre Abreu (abreu-alexandre) :
Revision history for this message
David Barth (dbarth) wrote :

Approving to silo the change. I will let Alberto add the check for && accountProvider not empty to get this in a better shape.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webcontainer/webapp-container.cpp'
2--- src/app/webcontainer/webapp-container.cpp 2014-08-26 07:15:22 +0000
3+++ src/app/webcontainer/webapp-container.cpp 2014-09-26 08:37:56 +0000
4@@ -49,6 +49,31 @@
5 namespace
6 {
7
8+/* Hack to clear the local data of the webapp, when it's integrated with OA:
9+ * https://bugs.launchpad.net/bugs/1371659
10+ * This is needed because cookie sets from different accounts might not
11+ * completely overwrite each other, and therefore we end up with an
12+ * inconsistent cookie jar. */
13+static void clearCookiesHack(const QString &provider)
14+{
15+ if (provider.isEmpty()) {
16+ qWarning() << "--clear-cookies only works with an accountProvider" << endl;
17+ return;
18+ }
19+
20+ /* check both ~/.local/share and ~/.cache, as the data will eventually be
21+ * moving from the first to the latter.
22+ */
23+ QStringList baseDirs;
24+ baseDirs << QStandardPaths::writableLocation(QStandardPaths::DataLocation);
25+ baseDirs << QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
26+
27+ Q_FOREACH(const QString &baseDir, baseDirs) {
28+ QDir dir(baseDir);
29+ dir.removeRecursively();
30+ }
31+}
32+
33 static QString currentArchitecturePathName()
34 {
35 #if defined(Q_PROCESSOR_X86_32)
36@@ -237,6 +262,9 @@
37 }
38 } else if (argument.startsWith("--accountProvider=")) {
39 m_accountProvider = argument.split("--accountProvider=")[1];
40+ } else if (argument == "--clear-cookies") {
41+ qWarning() << argument << " is an unsupported option: it can be removed without notice..." << endl;
42+ clearCookiesHack(m_accountProvider);
43 } else if (argument == "--store-session-cookies") {
44 m_storeSessionCookies = true;
45 } else if (argument == "--enable-back-forward") {

Subscribers

People subscribed via source and target branches

to status/vote changes: