Bad persistent directory path

Bug #1248632 reported by Víctor R. Ruiz on 2013-11-06
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cordova Ubuntu
Undecided
Unassigned
Cordova Ubuntu Tests
High
Víctor R. Ruiz
cordova-ubuntu-tests (Ubuntu)
Undecided
Unassigned

Bug Description

In my system now this path:
LOCAL_PERSISTENT_PATH= os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent/L2hvbWUvdnJydWl6L3dlYmFwcHMvbHAvY29yZG92YS11YnVudHUtdGVzdHMvd3d3')

should be this one instead:
LOCAL_PERSISTENT_PATH= os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent/L2hvbWUvdWJ1bnR1L2NvcmRvdmEtdWJ1bnR1LXRlc3RzL3d3dw==/')

We need a way to know the local persistent path that Cordova is using.

Related branches

Víctor R. Ruiz (vrruiz) on 2013-11-06
Changed in cordova-ubuntu-tests:
assignee: nobody → Víctor R. Ruiz (vrruiz)
Robert Bruce Park (robru) wrote :

Is there any reason that we can't just do this?

    glob('~/.local/share/cordova-ubuntu/persistent/*/')[0]

It would protect it against any future changes of this seemingly random string. Is there ever a situation in which there's more than one of these directories at a time?

Robert Bruce Park (robru) wrote :

Should be, sorry:

    glob(os.environ['HOME'] + '/.local/share/cordova-ubuntu/persistent/*/')[0]

> glob(os.environ['HOME'] + '/.local/share/cordova-
> ubuntu/persistent/*/')[0]

Apparently, each qml file generates its own directory, so depending if
Cordova Ubuntu tests have called main-local.qml or main.qml, there
exists one or two directories.

Víctor R. Ruiz (vrruiz) wrote :

The relevant code in Cordova Ubuntu is this

src/plugins/fileapi.cpp
m_persistentDir(QDir::homePath() + "/.local/share/cordova-ubuntu/persistent/" + QString(cordova->get_app_dir().toUtf8().toBase64()))

src/cordova.cpp
QString Cordova::get_app_dir() {
    return m_www.absolutePath();
}

So, in theory, doing something like base64.b64encode(absolute_path_dir) should work.

Robert Bruce Park (robru) wrote :

What is the value of absolute_path_dir?

Maxim Ermilov (zaspire) wrote :

> So, in theory, doing something like base64.b64encode(absolute_path_dir) should work
yes

PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:cordova-ubuntu-tests at revision 34, scheduled for release in cordova-ubuntu-tests, milestone Unknown

Changed in cordova-ubuntu-tests:
status: New → Fix Committed
Maxim Ermilov (zaspire) on 2014-04-25
Changed in cordova-ubuntu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers