Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26347

IOS: setRemoteBackup(flag) outputs an ERROR message when used on individual files.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.5.0
    • Component/s: iOS
    • Labels:
      None

      Description

      Since 7.3.0.GA+ I'm seeing an error when calling setRemoteBackup(bool) on an individual File object. "Could not configure remote backup: The file “mydatabase.db” couldn’t be opened." (Setting the flag on a folder works fine,)

      Looking at the code in TiFilesystemFileProxy.m around line 570, it appears that the object is setting the flag correctly (on the 'URL'), but then continues to treat the object as a folder, get the contents then output (not throw) an error if no contents are found. (Which a single file will always fail on).

      It's not a fatal error, but the code just shouldn't have got that far to output the ERROR message.

      A quick fix would be to change the setRemoteBackup method to :

      - (void)setRemoteBackup:(id)value
      {
        ENSURE_TYPE(value, NSNumber);
        BOOL isExcluded = ![TiUtils boolValue:value def:YES];
          NSNumber *isDirectory;
          BOOL success = [[NSURL fileURLWithPath:[self path]] getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:nil];
          if (success && [isDirectory boolValue]) {
              [self addSkipBackupAttributeToFolder:[NSURL fileURLWithPath:[self path]] withFlag:isExcluded];
          } else {
              [self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:[self path]] withFlag:isExcluded];
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              kosso kosso
              Tester:
              Samir Mohammed
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-6558
                  Sync status:
                  PENDING
                  Last received:
                  Last sent:

                  Git Source Code