Bad persistent directory path

Bug #1248632 reported by Víctor R. Ruiz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cordova Ubuntu
Fix Released
Undecided
Unassigned
Cordova Ubuntu Tests
Fix Committed
High
Víctor R. Ruiz
cordova-ubuntu-tests (Ubuntu)
New
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)
Changed in cordova-ubuntu-tests:
assignee: nobody → Víctor R. Ruiz (vrruiz)
Revision history for this message
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?

Revision history for this message
Robert Bruce Park (robru) wrote :

Should be, sorry:

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

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote : Re: [Bug 1248632] Re: Bad persistent directory path

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

Revision history for this message
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.

Revision history for this message
Robert Bruce Park (robru) wrote :

What is the value of absolute_path_dir?

Revision history for this message
Maxim Ermilov (zaspire) wrote :

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

Revision history for this message
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)
Changed in cordova-ubuntu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.