Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25352] Windows: Ti.Database.install should not prefix the specified path with the resourcesDirectory

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-08-22T00:22:44.000+0000
Affected Version/sRelease 7.0.0, Release 6.3.0, Release 6.2.2
Fix Version/sRelease 7.5.0
ComponentsWindows
Labelsn/a
ReporterEwan Harris
AssigneeKota Iguchi
Created2017-09-26T15:08:18.000+0000
Updated2018-08-22T00:22:50.000+0000

Description

Description

*This only occurs on ws-local target for me*, I have a fix locally just need to write a unit test When calling Ti.Database.install('/database/path.db', 'example') on Windows the function will throw an error. Tracking this down the error originates from the Ti.Filesystem APIs, used [here](https://github.com/appcelerator/titanium_mobile_windows/blob/67db155c01654c8442d32e418da6da66c1cf7aef/Source/TitaniumKit/src/DatabaseModule.cpp#L23-L35). After walking it through the error appeared to be caused by the path being like C:\Users\ewan\Documents\debug_proj\NG\NG.Windows10.Win32\Debug\AppX\\./databases/kitchensink.db, as the install function prefixes the resourcesDirectory onto the specified path. Based off documentation and other platforms I believe this is incorrect and the path should be passed through untouched allowing the Filesystem APIs to resolve it correctly

Steps to reproduce

Download the zipped resources and build for ws-local

Actual

Error is thrown
Error: copy: unknown exception

Expected

No error should be thrown

Attachments

FileDateSize
Resources.zip2017-09-26T15:05:41.000+00001372192

Comments

  1. Kota Iguchi 2018-02-08

    https://github.com/appcelerator/titanium_mobile_windows/pull/1181
  2. Josh Longton 2018-07-19

    *Closing ticket.* Tested using the test case above, I also used alert(Ti.Filesystem.getFile('./app.js').exists()); but it returned true before and after the fix The fix is present in SDK: {noformat} 7.4.0.v20180718223310 {noformat} *ENV* {noformat} Noka lumia 550 (Win 10) Ws-emulator Windows 10 Pro: 1803 Appc NPM: 4.2.13 Appc CLI: 7.0.4 Ti CLI Ver: 5.1.1 Node Ver: 8.9.1 NPM Ver: 6.1.0 {noformat}
  3. Kota Iguchi 2018-08-22

    Reopening this, just to update fixVersion.

JSON Source