Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27430] EncryptedDB ResultSet field and fieldByName functions are returning incorrect values on Android

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-10-15T17:10:46.000+0000
Affected Version/sRelease 8.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsencrypted_database, engSchedule, regression
ReporterRyan Aston
AssigneeGary Mathews
Created2019-08-28T20:52:57.000+0000
Updated2019-10-15T17:10:46.000+0000

Description

Calling .field() or .fieldByName() on an encrypteddatabase (3.0.4) ResultSet returns a boolean false if the value of the field is NULL. This issue seems to be isolated to this module on Android with the 8.1.0.GA SDK. 8.0.0.GA and iOS don't have this issue, nor does the built-in Ti.Database.ResultSet. A small sample project is linked below. Run this app on an Android device and see the discrepancies between the console log outputs for non-encDB and encDB. Running on iOS or switching back to 8.0.0.GA alleviates the discrepancy. Sample project: https://drive.google.com/file/d/1HW1jxvUPZ67_HVx1Phe-PqgJKeVQygLp/view?usp=sharing

Comments

  1. Rakhi Mitro 2019-08-29

    Hello, Tested the sample project shared by you with SDK 8.1.0.GA on android device 7. Got the following output on console:
       
       [INFO]  Testing 1.0 (Powered by Titanium 8.1.0.84c6734b2d)
       [WARN]  col fieldByName: null
       [WARN]  col field: null
       [WARN]  col fieldByName: false
       [WARN]  col field: false
       
    Are you experiencing the same? Please share the console logs of your end.
  2. Ryan Aston 2019-08-29

    Yes, that is exactly what my console log looks like. The last two lines should be identical to the two above them, but on Android with 8.1.0.GA they are not.
  3. Rakhi Mitro 2019-09-16

    Hello, Can you please test the issue on 8.1.1.GA and share us the console logs.
  4. Ryan Aston 2019-09-16

    The output is identical: {noformat} [INFO]   Testing 1.0 (Powered by Titanium 8.1.1.0148ee6e79) [WARN]   col fieldByName: null [WARN]   col field: null [WARN]   col fieldByName: false [WARN]   col field: false {noformat}
  5. Ryan Aston 2019-09-30

    Same with 8.2.0.GA: {noformat} [INFO]   Testing 1.0 (Powered by Titanium 8.2.0.6bfdf6e394) [WARN]   col fieldByName: null [WARN]   col field: null [WARN]   col fieldByName: false [WARN]   col field: false {noformat} We really need this resolved quickly. It is preventing us from upgrading to these newer SDKs.
  6. Gary Mathews 2019-10-09

    appcelerator.encrypteddatabase: https://github.com/appcelerator-modules/appcelerator.encrypteddatabase/pull/41
  7. Lokesh Choudhary 2019-10-10

    FR Passed.
  8. Lokesh Choudhary 2019-10-15

    Verified the fix with version 3.1.0. Closing.

JSON Source