From e6604be792dc9fd40223b8ae97be4d50cacc3e87 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Tue, 12 May 2026 12:28:28 +0200 Subject: [PATCH 1/2] - OCVaultLocation: fix vfsItemID for cases where only .vfsNodeID is not set, but the node is still a virtual node (=> should have affected mostly drive-representing VFS nodes) --- ownCloudSDK/Vaults/OCVaultLocation.m | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ownCloudSDK/Vaults/OCVaultLocation.m b/ownCloudSDK/Vaults/OCVaultLocation.m index c22c006c..c6a0b891 100644 --- a/ownCloudSDK/Vaults/OCVaultLocation.m +++ b/ownCloudSDK/Vaults/OCVaultLocation.m @@ -86,16 +86,13 @@ - (instancetype)initWithVFSItemID:(OCVFSItemID)vfsItemID - (OCVFSItemID)vfsItemID { - if (_vfsNodeID != nil) + if ((_bookmarkUUID != nil) && (_driveID != nil) && _isVirtual) { - if ((_bookmarkUUID != nil) && (_driveID != nil)) - { - return ([[NSString alloc] initWithFormat:@"V\\%@\\%@", _bookmarkUUID, _driveID]); - } - else - { - return ([[NSString alloc] initWithFormat:@"V\\%@", _vfsNodeID]); - } + return ([[NSString alloc] initWithFormat:@"V\\%@\\%@", _bookmarkUUID, _driveID]); + } + else if (_vfsNodeID != nil) + { + return ([[NSString alloc] initWithFormat:@"V\\%@", _vfsNodeID]); } else if ((_bookmarkUUID != nil) && (_localID != nil)) { From 60d980bada516a7cb2f6a24a8f07947ec17a1374 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Sun, 31 May 2026 18:16:30 +0200 Subject: [PATCH 2/2] - OCBookmark: - add new .uuidString property (including caching) to avoid OCBookmark.uuid.uuidString calls - switch from bookmark.uuid.UUIDString to bookmark.uuidString across the codebase - OCSyncContext: - modernize syntax for private ivars - add new mechanism to add completion handler(s) to run after context actions have run - OCSyncActionCreateFolder: - add bookmarkUUID to placeholderItem - run the placeholder completion handler only after the folder item has been added to the database - OCVaultLocation: add debug description - OCVFSCore: add (and comment out) verbose debug logging for resolution --- .../OCAuthenticationMethodOAuth2.m | 2 +- ownCloudSDK/Bookmark/OCBookmark.h | 1 + ownCloudSDK/Bookmark/OCBookmark.m | 19 ++++++++-- ownCloudSDK/Connection/OCConnection+Upload.m | 2 +- ownCloudSDK/Connection/OCConnection.m | 9 ++++- ownCloudSDK/Core/ItemList/OCCore+ItemList.m | 2 +- .../Core/ItemPolicies/OCCore+ItemPolicies.m | 2 +- ownCloudSDK/Core/OCCore.m | 4 +- .../Core/Resources/Sources/OCResourceSource.m | 2 +- .../CreateFolder/OCSyncActionCreateFolder.m | 9 ++++- ownCloudSDK/Core/Sync/Context/OCSyncContext.h | 6 +++ ownCloudSDK/Core/Sync/Context/OCSyncContext.m | 37 ++++++++++++++++--- ownCloudSDK/Core/Sync/OCCore+SyncEngine.m | 12 +++--- .../Resource Management/OCCoreManager.m | 2 +- ownCloudSDK/VFS/OCVFSCore.m | 11 ++++++ ownCloudSDK/Vaults/OCVaultLocation.m | 13 +++++++ 16 files changed, 109 insertions(+), 24 deletions(-) diff --git a/ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m b/ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m index 33ebcf45..34f2c48e 100644 --- a/ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m +++ b/ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m @@ -777,7 +777,7 @@ - (void)_refreshTokenForConnection:(OCConnection *)connection availabilityHandle { __weak OCAuthenticationMethodOAuth2 *weakSelf = self; - OCLockRequest *lockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[NSString stringWithFormat:@"authentication-data-update:%@", connection.bookmark.uuid.UUIDString] acquiredHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) { + OCLockRequest *lockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[NSString stringWithFormat:@"authentication-data-update:%@", connection.bookmark.uuidString] acquiredHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) { // Wait for exclusive lock on authentication data before performing the refresh [weakSelf __refreshTokenForConnection:connection availabilityHandler:^(NSError *error, BOOL authenticationIsAvailable) { // Invoke original availabilityHandler diff --git a/ownCloudSDK/Bookmark/OCBookmark.h b/ownCloudSDK/Bookmark/OCBookmark.h index bab41a57..cd72d04b 100644 --- a/ownCloudSDK/Bookmark/OCBookmark.h +++ b/ownCloudSDK/Bookmark/OCBookmark.h @@ -42,6 +42,7 @@ NS_ASSUME_NONNULL_BEGIN @interface OCBookmark : NSObject @property(readonly) OCBookmarkUUID uuid; //!< UUID uniquely identifying the bookmark +@property(readonly,nonatomic) OCBookmarkUUIDString uuidString; //!< String version of .uuid (cached!) @property(strong,nullable) NSString *name; //!< Name of the server @property(strong,nullable) NSURL *url; //!< URL to use to connect to the server diff --git a/ownCloudSDK/Bookmark/OCBookmark.m b/ownCloudSDK/Bookmark/OCBookmark.m index 7b238d59..58b8b9fb 100644 --- a/ownCloudSDK/Bookmark/OCBookmark.m +++ b/ownCloudSDK/Bookmark/OCBookmark.m @@ -28,7 +28,7 @@ #import #endif /* TARGET_OS_IOS */ -@interface OCBookmark () +@implementation OCBookmark { OCIPCNotificationName _coreUpdateNotificationName; OCIPCNotificationName _bookmarkAuthUpdateNotificationName; @@ -40,10 +40,9 @@ @interface OCBookmark () NSString *_lastUsername; NSString *_lastDescription; -} -@end -@implementation OCBookmark + OCBookmarkUUIDString _uuidString; +} @synthesize uuid = _uuid; @@ -119,6 +118,17 @@ - (NSData *)bookmarkData return ([NSKeyedArchiver archivedDataWithRootObject:self]); } +#pragma mark - UUID string +- (OCBookmarkUUIDString)uuidString +{ + if (_uuidString == nil) + { + _uuidString = _uuid.UUIDString; + } + + return (_uuidString); +} + #pragma mark - Keychain access - (NSData *)authenticationData { @@ -462,6 +472,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder if ((self = [self init]) != nil) { _uuid = [decoder decodeObjectOfClass:NSUUID.class forKey:@"uuid"]; + _uuidString = nil; _name = [decoder decodeObjectOfClass:NSString.class forKey:@"name"]; _url = [decoder decodeObjectOfClass:NSURL.class forKey:@"url"]; diff --git a/ownCloudSDK/Connection/OCConnection+Upload.m b/ownCloudSDK/Connection/OCConnection+Upload.m index 7c185e7c..8f3eb0f7 100644 --- a/ownCloudSDK/Connection/OCConnection+Upload.m +++ b/ownCloudSDK/Connection/OCConnection+Upload.m @@ -322,7 +322,7 @@ - (OCProgress *)_continueTusJob:(OCTUSJob *)tusJob lastTask:(NSString *)lastTask } tusProgress = [[OCProgress alloc] initWithPath:((self.bookmark.uuid != nil) ? - @[ OCProgressPathElementIdentifierCoreRoot, self.bookmark.uuid.UUIDString, OCProgressPathElementIdentifierCoreConnectionPath, tusJob.trackingID ] : + @[ OCProgressPathElementIdentifierCoreRoot, self.bookmark.uuidString, OCProgressPathElementIdentifierCoreConnectionPath, tusJob.trackingID ] : @[]) progress:actionProgress]; } diff --git a/ownCloudSDK/Connection/OCConnection.m b/ownCloudSDK/Connection/OCConnection.m index f3f90e41..84cf88fe 100644 --- a/ownCloudSDK/Connection/OCConnection.m +++ b/ownCloudSDK/Connection/OCConnection.m @@ -473,7 +473,7 @@ - (instancetype)initWithBookmark:(OCBookmark *)bookmark { if ((self = [super init]) != nil) { - _partitionID = bookmark.uuid.UUIDString; + _partitionID = bookmark.uuidString; self.bookmark = bookmark; @@ -2076,6 +2076,13 @@ - (void)_handleRetrieveItemListAtPathResult:(OCHTTPRequest *)request error:(NSEr { event.error = errors.firstObject; } + else if (items != nil) + { + OCBookmarkUUIDString bookmarkUUIDString = self.bookmark.uuidString; + for (OCItem *item in items) { + item.bookmarkUUID = bookmarkUUIDString; + } + } switch (eventType) { diff --git a/ownCloudSDK/Core/ItemList/OCCore+ItemList.m b/ownCloudSDK/Core/ItemList/OCCore+ItemList.m index 463aaa69..aa9072b8 100644 --- a/ownCloudSDK/Core/ItemList/OCCore+ItemList.m +++ b/ownCloudSDK/Core/ItemList/OCCore+ItemList.m @@ -1957,7 +1957,7 @@ - (void)_coordinatedScanForChanges if (_scanForChangesLockRequest == nil) // do not make second request if another one is already in progress - do nothing in that case { - _scanForChangesLockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[OCLockResourceIdentifierCoreUpdateScan stringByAppendingFormat:@":%@",_bookmark.uuid.UUIDString] tryAcquireHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) { + _scanForChangesLockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[OCLockResourceIdentifierCoreUpdateScan stringByAppendingFormat:@":%@",_bookmark.uuidString] tryAcquireHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) { OCCore *core; if ((core = weakSelf) != nil) diff --git a/ownCloudSDK/Core/ItemPolicies/OCCore+ItemPolicies.m b/ownCloudSDK/Core/ItemPolicies/OCCore+ItemPolicies.m index 124f52ab..2c4251ad 100644 --- a/ownCloudSDK/Core/ItemPolicies/OCCore+ItemPolicies.m +++ b/ownCloudSDK/Core/ItemPolicies/OCCore+ItemPolicies.m @@ -441,7 +441,7 @@ - (void)_updatePolicyProcessors #pragma mark - IPC - (OCIPCNotificationName)itemPoliciesChangedNotificationName { - return ([OCIPCNotificationNameItemPoliciesChangedPrefix stringByAppendingFormat:@".%@", self.bookmark.uuid.UUIDString]); + return ([OCIPCNotificationNameItemPoliciesChangedPrefix stringByAppendingFormat:@".%@", self.bookmark.uuidString]); } - (void)setupItemPolicies diff --git a/ownCloudSDK/Core/OCCore.m b/ownCloudSDK/Core/OCCore.m index b562ca15..d8ffb2b6 100644 --- a/ownCloudSDK/Core/OCCore.m +++ b/ownCloudSDK/Core/OCCore.m @@ -257,7 +257,7 @@ - (instancetype)initWithBookmark:(OCBookmark *)bookmark _preferredChecksumAlgorithm = OCChecksumAlgorithmIdentifierSHA1; - _eventHandlerIdentifier = [@"OCCore-" stringByAppendingString:_bookmark.uuid.UUIDString]; + _eventHandlerIdentifier = [@"OCCore-" stringByAppendingString:_bookmark.uuidString]; _pendingThumbnailRequests = [NSMutableDictionary new]; _ipNotificationCenter = OCIPNotificationCenter.sharedNotificationCenter; @@ -318,7 +318,7 @@ - (instancetype)initWithBookmark:(OCBookmark *)bookmark }]); }]; - _activityManager = [[OCActivityManager alloc] initWithUpdateNotificationName:[@"OCCore.ActivityUpdate." stringByAppendingString:_bookmark.uuid.UUIDString]]; + _activityManager = [[OCActivityManager alloc] initWithUpdateNotificationName:[@"OCCore.ActivityUpdate." stringByAppendingString:_bookmark.uuidString]]; _publishedActivitySyncRecordIDs = [NSMutableSet new]; _itemPolicies = [NSMutableArray new]; diff --git a/ownCloudSDK/Core/Resources/Sources/OCResourceSource.m b/ownCloudSDK/Core/Resources/Sources/OCResourceSource.m index c60027b4..4d049b23 100644 --- a/ownCloudSDK/Core/Resources/Sources/OCResourceSource.m +++ b/ownCloudSDK/Core/Resources/Sources/OCResourceSource.m @@ -29,7 +29,7 @@ - (instancetype)initWithCore:(OCCore *)core if ((self = [super init]) != nil) { _core = core; - _eventHandlerIdentifier = [NSString stringWithFormat:@"%@-%@-%@", NSStringFromClass(self.class), self.identifier, core.bookmark.uuid.UUIDString]; + _eventHandlerIdentifier = [NSString stringWithFormat:@"%@-%@-%@", NSStringFromClass(self.class), self.identifier, core.bookmark.uuidString]; } return (self); diff --git a/ownCloudSDK/Core/Sync/Actions/CreateFolder/OCSyncActionCreateFolder.m b/ownCloudSDK/Core/Sync/Actions/CreateFolder/OCSyncActionCreateFolder.m index 097f1bd4..2212a7f3 100644 --- a/ownCloudSDK/Core/Sync/Actions/CreateFolder/OCSyncActionCreateFolder.m +++ b/ownCloudSDK/Core/Sync/Actions/CreateFolder/OCSyncActionCreateFolder.m @@ -38,6 +38,7 @@ - (instancetype)initWithParentItem:(OCItem *)parentItem folderName:(NSString *)f if ((placeholderItem = [OCItem placeholderItemOfType:OCItemTypeCollection]) != nil) { + placeholderItem.bookmarkUUID = self.core.bookmark.uuidString; placeholderItem.parentFileID = parentItem.fileID; placeholderItem.parentLocalID = parentItem.localID; placeholderItem.driveID = parentItem.driveID; @@ -73,7 +74,13 @@ - (void)preflightWithContext:(OCSyncContext *)syncContext if ((placeholderCompletionHandler = self.ephermalParameters[OCCoreOptionPlaceholderCompletionHandler]) != nil) { - placeholderCompletionHandler(nil, _placeholderItem); + OCItem *placeholderItem = _placeholderItem; + + // Run completion handler only after database updates have been performed, so the returned item is immediately usable + [syncContext addContextActionsCompletionHandler:^{ + placeholderCompletionHandler(nil, placeholderItem); + }]; + self.ephermalParameters = nil; } diff --git a/ownCloudSDK/Core/Sync/Context/OCSyncContext.h b/ownCloudSDK/Core/Sync/Context/OCSyncContext.h index dd38a56b..a03d9433 100644 --- a/ownCloudSDK/Core/Sync/Context/OCSyncContext.h +++ b/ownCloudSDK/Core/Sync/Context/OCSyncContext.h @@ -24,6 +24,8 @@ @class OCSyncIssue; @class OCWaitCondition; +typedef dispatch_block_t OCSyncContextActionsCompletionHandler; + NS_ASSUME_NONNULL_BEGIN @interface OCSyncContext : NSObject @@ -58,9 +60,13 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)eventHandlingContextWith:(OCSyncRecord *)syncRecord event:(OCEvent *)event; + (instancetype)waitConditionRecoveryContextWith:(OCSyncRecord *)syncRecord; +#pragma mark - Add objects - (void)addWaitCondition:(OCWaitCondition *)waitCondition; - (void)addSyncIssue:(OCSyncIssue *)syncIssue; +- (void)addContextActionsCompletionHandler:(OCSyncContextActionsCompletionHandler)completionHandler; //!< Adds a block to run after the sync context actions have been completed (f.ex. updates to the database have been completed) +- (void)runContextCompletionHandlers; + #pragma mark - State - (void)transitionToState:(OCSyncRecordState)state withWaitConditions:(nullable NSArray *)waitConditions; //!< Convenience method, calling the same method on .syncRecord, but also adding in .queuedWaitConditins and setting updateStoredSyncRecordAfterItemUpdates to YES. diff --git a/ownCloudSDK/Core/Sync/Context/OCSyncContext.m b/ownCloudSDK/Core/Sync/Context/OCSyncContext.m index 57840588..84000ace 100644 --- a/ownCloudSDK/Core/Sync/Context/OCSyncContext.m +++ b/ownCloudSDK/Core/Sync/Context/OCSyncContext.m @@ -22,15 +22,12 @@ #import "OCSyncIssue.h" #import "OCWaitConditionIssue.h" -@interface OCSyncContext () +@implementation OCSyncContext { BOOL _canHandleErrors; + NSMutableArray *_actionsCompletionHandler; } -@end - -@implementation OCSyncContext - + (instancetype)preflightContextWithSyncRecord:(OCSyncRecord *)syncRecord { OCSyncContext *syncContext = [OCSyncContext new]; @@ -98,6 +95,36 @@ - (void)addSyncIssue:(OCSyncIssue *)syncIssue [self addWaitCondition:[syncIssue makeWaitCondition]]; } +- (void)addContextActionsCompletionHandler:(OCSyncContextActionsCompletionHandler)completionHandler +{ + @synchronized(self) + { + if (_actionsCompletionHandler == nil) { + _actionsCompletionHandler = [NSMutableArray new]; + } + + [_actionsCompletionHandler addObject:completionHandler]; + } +} + +- (void)runContextCompletionHandlers +{ + NSMutableArray *completionHandlers; + + @synchronized (self) + { + completionHandlers = _actionsCompletionHandler; + _actionsCompletionHandler = nil; + } + + if (completionHandlers == nil) { return; } + + for (OCSyncContextActionsCompletionHandler completionHandler in completionHandlers) + { + completionHandler(); + } +} + #pragma mark - State - (void)transitionToState:(OCSyncRecordState)state withWaitConditions:(nullable NSArray *)waitConditions { diff --git a/ownCloudSDK/Core/Sync/OCCore+SyncEngine.m b/ownCloudSDK/Core/Sync/OCCore+SyncEngine.m index 1d47f99b..4fc53679 100644 --- a/ownCloudSDK/Core/Sync/OCCore+SyncEngine.m +++ b/ownCloudSDK/Core/Sync/OCCore+SyncEngine.m @@ -54,17 +54,17 @@ @implementation OCCore (SyncEngine) #pragma mark - Setup & shutdown - (OCIPCNotificationName)notificationNameForProcessSyncRecordsTriggerForProcessSession:(OCProcessSession *)processSession { - return ([OCIPCNotificationNameProcessSyncRecordsBase stringByAppendingFormat:@":%@;%@", self.bookmark.uuid.UUIDString, processSession.bundleIdentifier]); + return ([OCIPCNotificationNameProcessSyncRecordsBase stringByAppendingFormat:@":%@;%@", self.bookmark.uuidString, processSession.bundleIdentifier]); } - (OCIPCNotificationName)notificationNameForProcessSyncRecordsTriggerAcknowledgementForProcessSession:(OCProcessSession *)processSession { - return ([OCIPCNotificationNameProcessSyncRecordsBase stringByAppendingFormat:@":%@;%@;ack", self.bookmark.uuid.UUIDString, processSession.bundleIdentifier]); + return ([OCIPCNotificationNameProcessSyncRecordsBase stringByAppendingFormat:@":%@;%@;ack", self.bookmark.uuidString, processSession.bundleIdentifier]); } - (OCIPCNotificationName)notificationNameForSyncRecordsUpdate { - return ([OCIPCNotificationNameUpdateSyncRecordsBase stringByAppendingFormat:@":%@", self.bookmark.uuid.UUIDString]); + return ([OCIPCNotificationNameUpdateSyncRecordsBase stringByAppendingFormat:@":%@", self.bookmark.uuidString]); } - (void)setupSyncEngine @@ -363,7 +363,7 @@ - (void)submitSyncRecord:(OCSyncRecord *)record withPreflightResultHandler:(OCCo OCLogDebug(@"record %@ added to database with error %@", record, blockError); // Set sync record's progress path - record.progress.path = @[OCProgressPathElementIdentifierCoreRoot, self.bookmark.uuid.UUIDString, OCProgressPathElementIdentifierCoreSyncRecordPath, [record.recordID stringValue]]; + record.progress.path = @[OCProgressPathElementIdentifierCoreRoot, self.bookmark.uuidString, OCProgressPathElementIdentifierCoreSyncRecordPath, [record.recordID stringValue]]; // Pre-flight BOOL recordRemovedSelf = NO; @@ -1614,6 +1614,8 @@ - (void)performSyncContextActions:(OCSyncContext *)syncContext [self _scheduleNextWaitConditionRunForRecord:syncContext.syncRecord]; [self performUpdatesForAddedItems:syncContext.addedItems removedItems:syncContext.removedItems updatedItems:syncContext.updatedItems refreshLocations:syncContext.refreshLocations newSyncAnchor:nil beforeQueryUpdates:beforeQueryUpdateAction afterQueryUpdates:nil queryPostProcessor:nil skipDatabase:NO]; + + [syncContext runContextCompletionHandlers]; } - (void)_scheduleNextWaitConditionRunForRecord:(OCSyncRecord *)syncRecord @@ -2127,7 +2129,7 @@ - (void)restartStuckSyncRecordsWithFilter:(nullable NSArray * _N // Retrieve tracking IDs and total number of requests (incl. without tracking ID) from HTTP pipeline backend OCSyncExec(trackingIDsRetrieved, { - [OCHTTPPipelineManager.sharedPipelineManager.backend retrieveActionTrackingIDsForPartition:self.connection.bookmark.uuid.UUIDString resultHandler:^(NSError * _Nullable error, NSSet * _Nullable trackingIDs, NSNumber * _Nullable totalNumberOfRequestsInBackend) { + [OCHTTPPipelineManager.sharedPipelineManager.backend retrieveActionTrackingIDsForPartition:self.connection.bookmark.uuidString resultHandler:^(NSError * _Nullable error, NSSet * _Nullable trackingIDs, NSNumber * _Nullable totalNumberOfRequestsInBackend) { httpActionTrackingIDs = trackingIDs; totalNumberOfRequestsInBackendForPartition = totalNumberOfRequestsInBackend; OCTLogDebug(@[@"Health"], @"Found HTTP requests with trackingIDs=%@ total=%@ error=%@ (1)", trackingIDs, totalNumberOfRequestsInBackend, error); diff --git a/ownCloudSDK/Resource Management/OCCoreManager.m b/ownCloudSDK/Resource Management/OCCoreManager.m index 19bf476f..9bd3e005 100644 --- a/ownCloudSDK/Resource Management/OCCoreManager.m +++ b/ownCloudSDK/Resource Management/OCCoreManager.m @@ -253,7 +253,7 @@ - (void)_returnCoreForBookmark:(OCBookmark *)bookmark completionHandler:(dispatc { NSNumber *requestCount = _requestCountByUUID[bookmark.uuid]; - OCLogDebug(@"core returned for bookmark %@ (%@)", bookmark.uuid.UUIDString, bookmark.name); + OCLogDebug(@"core returned for bookmark %@ (%@)", bookmark.uuidString, bookmark.name); if (requestCount.integerValue > 0) { diff --git a/ownCloudSDK/VFS/OCVFSCore.m b/ownCloudSDK/VFS/OCVFSCore.m index 0aa3f77c..488abe4d 100644 --- a/ownCloudSDK/VFS/OCVFSCore.m +++ b/ownCloudSDK/VFS/OCVFSCore.m @@ -178,6 +178,8 @@ - (void)_relinquishCore:(OCCore *)core return (self.rootNode); } + // OCLogVerbose(@"Resolving %@: start", identifier); + if ((location = [[OCVaultLocation alloc] initWithVFSItemID:identifier]) != nil) { if (location.vfsNodeID != nil) @@ -187,6 +189,8 @@ - (void)_relinquishCore:(OCCore *)core { item = (id)[_nodesByID objectForKey:location.vfsNodeID]; } + + // OCLogVerbose(@"Resolving %@: vfs node from _nodesByID: %@ -- location: %@", identifier, item, location); } else if (location.isVirtual) { @@ -195,6 +199,7 @@ - (void)_relinquishCore:(OCCore *)core { item = (id)[self driveRootNodeForLocation:[[OCLocation alloc] initWithBookmarkUUID:location.bookmarkUUID driveID:location.driveID path:@"/"]]; } + // OCLogVerbose(@"Resolving %@: virtual node from driveRootNodeForLocation: %@ -- location: %@", identifier, item, location); } else { @@ -227,8 +232,14 @@ - (void)_relinquishCore:(OCCore *)core } } + + // OCLogVerbose(@"Resolving %@: other item, via database: %@ -- location: %@", identifier, item, location); } } + else + { + // OCLogVerbose(@"Resolving %@: parsing as OCVaultLocation failed", identifier); + } if (outError != NULL) { diff --git a/ownCloudSDK/Vaults/OCVaultLocation.m b/ownCloudSDK/Vaults/OCVaultLocation.m index c6a0b891..30dab7b4 100644 --- a/ownCloudSDK/Vaults/OCVaultLocation.m +++ b/ownCloudSDK/Vaults/OCVaultLocation.m @@ -18,6 +18,7 @@ #import "OCVaultLocation.h" #import "OCVFSCore.h" +#import "OCMacros.h" @implementation OCVaultLocation @@ -102,4 +103,16 @@ - (OCVFSItemID)vfsItemID return (nil); } +#pragma mark - Description +- (NSString *)description +{ + return ([NSString stringWithFormat:@"<%@: %p, isVirtual: %d%@%@%@%@>", NSStringFromClass(self.class), self, + _isVirtual, + OCExpandVar(bookmarkUUID), + OCExpandVar(driveID), + OCExpandVar(localID), + OCExpandVar(vfsNodeID) + ]); +} + @end