[TIMOB-4469] Android: Filesystem exists() method used on file in resourcesDirectory always returns true even if the file is not present
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-04T13:51:59.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Sprint 2011-37, Release 1.8.0 |
Components | Android |
Labels | module_filesystem, qe-testadded |
Reporter | Anirudh Nagesh |
Assignee | Allen Yeung |
Created | 2011-06-21T12:42:12.000+0000 |
Updated | 2013-11-13T12:35:59.000+0000 |
Description
Note: please see [this comment|#comment-164088] below for clearer testcase and accurate explanation of the bug.
1. create an empty mobile project.
2. Copy the following sample code. http://pastie.org/2102937
3. The image is not loaded even if it is present in the filesystem.
Works fine with Ti SDK 1.6.2
Please move the example code from pastie to the actual ticket. Also, does it fail if you don't put the @ in the name.
the code snippet can be found below.
2. No, it does not fail if '@' is not in the name.
sending back to dev with required info.
kicking back so Don can see it
Will look into why it's returning true. It should not.
Attaching code where I added more logging statements. I could not get this to fail. It is not always returning true.
Don, I can still reproduce the issue with 1.7.0! I double checked it with both 1.6.2 and 1.7.0 In 1.6.2, 'exists()' returns false and true properly when the file is not present in the resources directory. In 1.7.0, it always returns true. Please let me know if you need any further information.
This has been reported again in TC-211. Note that this issue specifically occurs for testing the existence of files in resourcesDirectory. Other locations, such as applicationDataDirectory, are not affected. Environment Information: * Titanium SDK version: 1.7.2.97c3689. * Platform & version: Android 2.1.1 and Android 2.3.3 * Device Details: Android 2.1.1 and Android 2.3.3 * Host Operating System: OSX 10.7 (Lion) * Titanium Studio version: Titanium Studio, build: 1.0.2.201107130739 The user has observed this problem using the following Titanium SDKs: * 1.7.1 - No bug * 1.7.2 - Bug exists * 1.7.3 - Bug exists I have also verified that the issue still exists in 1.7.3. The user has provided a simpler testcase as follows:
Expected Results:
Actual Results:
folder.exists()
Description
exists() returns "false" when pointing to a folder that exists and "true" when the folder does not existSteps to reproduce
Step 1: create a new app Step 2: run the code below Step 3: click the window Step 4: look in the console Step 5: notice that there is no "data" directory but exists returns "true" Step 6: create a "data" directory in Resources, and create a couple files inside it Step 7: make a small change to tiapp.xml, delete the change, and save the file so that fastdev will pull in your new folder Step 8: run the app Step 9: click the window Step 10: notice that there is now a "data" directory but exists returns "false" Step 11: notice that getDirectoryListing listed the contents of your data directory, proving that the folder is indeed thereRepro Case
Environment
TiSDK 1.7.2 Android Emulator 2.2Associated Helpdesk Ticket
http://appc.me/c/APP-728922We need to make sure to test the fix for this with Fastdev automatic changes, it looks like the current changeset disables it completely. The test is pretty simple: * Run the project from TiStudio on the emulator (Fastdev should be automatically started) * After the app starts, change some JS code directly in TiStudio * Re-run the app (it should restart almost immediately, and have the changes you just made -- coming from FastDev mode)
Tested on Ti Studio 1.0.7.201112080131 Ti Mob SDK 1.8.0.1.v20111209011840 OSX Lion Nexus S OS 2.3.6, Android emulator with fast dev mode on Expected filesystem behavior is shown
Reopening/closing to add/remove labels