Skip to content

Commit 1093eca

Browse files
[milestone/11.7.2] Version 11.8 (#89)
* - Browser Session Class: add AWBrowser to simplify configuration for AirWatch browser * - no longer output "computed: '<null>'" entries for class settings in the LogIntro if it is the only entry for that MDM parameter * - OCAuthenticationMethodOAuth2: use UUIDString instead of UUID description for lock name - OCCore+FileProvider: add handling for edge case when the database is not available or not open, preventing a hang - OCCore+ItemList: implement coordinated scan for changes - synchronizes scans for changes across processes - prioritizes scans, giving the app highest and the fileprovider second highest priority - consolidate related log messages under ScanChanges tag (including PollForChanges and UpdateScan) - OCLock: add support for trying to acquire a lock and immediately returning with the result, with a new OCErrorLockInvalidated error code in case the lock couldn't be acquired - OCDatabase: add .isOpened property - OCSQLiteDB: disable statement caching in minimum memory configuration * - change "refresh_token" to "refresh token" in English Localizable.strings. * - OCLocale: modular localization system replacing direct system localization calls - OCLocaleFilter: layers that strings run through during localization to allow transformations - ClassSettings: allows overriding individual strings with replacements provided through a dictionary from class settings - Variables - allows replacing {{variables}} with values, or dynamic content from "variable sources" - shared instance allows addition of sources and changing variables at runtime - provides generally useful variables like app.name - change OCLocalized() set of macros to call OCLocale, not NSLocalizedString/NSBundle directly * - OCLocale: - fix bug when replacing placeholders with sources - add support for passing additional variables via options (+ OCLocalizedFormat macro) * - OCLocaleFilterVariables: add missing "{{" and "}}" in search term for replacements * - OCCapabilities: add support for dav > propfind > depth_infinity capability * - OCItemPolicyProcessorVacuum: fix wrong metadata type for OCClassSettingsKeyItemPolicyVacuumSyncAnchorTTL (bool -> integer) * - Add CHANGELOG for 11.8 release
1 parent 6417702 commit 1093eca

38 files changed

+1344
-90
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 11.8 version
2+
- Infinite PROPFIND: add support for dav > propfind > depth_infinity capability
3+
- OCLocale: modular localization system replacing direct system localization calls, allowing overrides via MDM and Branding.plist, adding variable support
4+
- OCCore+FileProvider: add handling for edge case when the database is not available or not open, preventing a hang
5+
- OCCore+ItemList: implement coordinated scan for changes
6+
- synchronizes scans for changes across processes
7+
- prioritizes scans, giving the app highest and the fileprovider second highest priority
8+
- consolidate related log messages under ScanChanges tag (including PollForChanges and UpdateScan)
9+
- OCLock: add support for trying to acquire a lock and immediately returning with the result, with a new OCErrorLockInvalidated error code in case the lock couldn't be acquired
10+
- OCSQLiteDB: disable statement caching in minimum memory configuration
11+
- Browser Session Class: add AWBrowser to simplify configuration for AirWatch browser
12+
- Class Settings: metadata type corrections; no longer output "computed: '<null>'" entries for class settings in the LogIntro if it is the only entry for that MDM parameter
13+
114
## 11.7.1 version
215

316
- support for streaming, infinite PROPFIND to prepopulate accounts and speed up initial discovery

ownCloudSDK.xcodeproj/project.pbxproj

+64
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// OCAuthenticationBrowserSessionAWBrowser.h
3+
// ownCloudSDK
4+
//
5+
// Created by Felix Schwarz on 23.09.21.
6+
// Copyright © 2021 ownCloud GmbH. All rights reserved.
7+
//
8+
9+
/*
10+
* Copyright (C) 2021, ownCloud GmbH.
11+
*
12+
* This code is covered by the GNU Public License Version 3.
13+
*
14+
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
15+
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
16+
*
17+
*/
18+
19+
#import <ownCloudSDK/ownCloudSDK.h>
20+
21+
NS_ASSUME_NONNULL_BEGIN
22+
23+
@interface OCAuthenticationBrowserSessionAWBrowser : OCAuthenticationBrowserSessionCustomScheme
24+
25+
@end
26+
27+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// OCAuthenticationBrowserSessionAWBrowser.m
3+
// ownCloudSDK
4+
//
5+
// Created by Felix Schwarz on 23.09.21.
6+
// Copyright © 2021 ownCloud GmbH. All rights reserved.
7+
//
8+
9+
/*
10+
* Copyright (C) 2021, ownCloud GmbH.
11+
*
12+
* This code is covered by the GNU Public License Version 3.
13+
*
14+
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
15+
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
16+
*
17+
*/
18+
19+
#import "OCAuthenticationBrowserSessionAWBrowser.h"
20+
21+
@implementation OCAuthenticationBrowserSessionAWBrowser
22+
23+
- (NSString *)plainCustomScheme
24+
{
25+
return (@"awb");
26+
}
27+
28+
- (NSString *)secureCustomScheme
29+
{
30+
return (@"awbs");
31+
}
32+
33+
@end

ownCloudSDK/Authentication/OCAuthenticationMethod.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ + (OCClassSettingsMetadataCollection)classSettingsMetadata
342342
@"operating-system" : @"Use ASWebAuthenticationSession for browser sessions.",
343343
@"UIWebView" : @"Use UIWebView for browser sessions. Requires compilation with `OC_FEATURE_AVAILABLE_UIWEBVIEW_BROWSER_SESSION=1` preprocessor flag.",
344344
@"CustomScheme" : @"Replace http and https with custom schemes to delegate browser sessions to a different app.",
345-
@"MIBrowser" : @"Replace `http` with `mibrowser` and `https` with `mibrowsers` to delegate browser sessions to the MobileIron browser."
345+
@"MIBrowser" : @"Replace `http` with `mibrowser` and `https` with `mibrowsers` to delegate browser sessions to the MobileIron browser.",
346+
@"AWBrowser" : @"Replace `http` with `awb` and `https` with `awbs` to delegate browser sessions to the AirWatch browser."
346347
},
347348
OCClassSettingsMetadataKeyCategory : @"Authentication"
348349
},

ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ - (void)_refreshTokenForConnection:(OCConnection *)connection availabilityHandle
626626
{
627627
__weak OCAuthenticationMethodOAuth2 *weakSelf = self;
628628

629-
OCLockRequest *lockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[NSString stringWithFormat:@"authentication-data-update:%@", connection.bookmark.uuid] acquiredHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) {
629+
OCLockRequest *lockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[NSString stringWithFormat:@"authentication-data-update:%@", connection.bookmark.uuid.UUIDString] acquiredHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) {
630630
// Wait for exclusive lock on authentication data before performing the refresh
631631
[weakSelf __refreshTokenForConnection:connection availabilityHandler:^(NSError *error, BOOL authenticationIsAvailable) {
632632
// Invoke original availabilityHandler

ownCloudSDK/Connection/Capabilities/OCCapabilities.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ typedef NSNumber* OCCapabilityBool;
5555
#pragma mark - DAV
5656
@property(readonly,nullable,nonatomic) NSString *davChunkingVersion;
5757
@property(readonly,nullable,nonatomic) NSArray<NSString *> *davReports;
58+
@property(readonly,nullable,nonatomic) OCCapabilityBool davPropfindSupportsDepthInfinity;
5859

5960
#pragma mark - TUS
6061
@property(readonly,nonatomic) BOOL tusSupported;
@@ -73,7 +74,6 @@ typedef NSNumber* OCCapabilityBool;
7374
@property(readonly,nullable,nonatomic) NSArray<NSString *> *blacklistedFiles;
7475
@property(readonly,nullable,nonatomic) OCCapabilityBool supportsUndelete;
7576
@property(readonly,nullable,nonatomic) OCCapabilityBool supportsVersioning;
76-
@property(readonly,nullable,nonatomic) OCCapabilityBool supportsInfinitePropfind;
7777

7878
#pragma mark - Sharing
7979
@property(readonly,nullable,nonatomic) OCCapabilityBool sharingAPIEnabled;

ownCloudSDK/Connection/Capabilities/OCCapabilities.m

+6-7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ @implementation OCCapabilities
6060
#pragma mark - DAV
6161
@dynamic davChunkingVersion;
6262
@dynamic davReports;
63+
@dynamic davPropfindSupportsDepthInfinity;
6364

6465
#pragma mark - TUS
6566
@dynamic tusSupported;
@@ -78,7 +79,6 @@ @implementation OCCapabilities
7879
@dynamic blacklistedFiles;
7980
@dynamic supportsUndelete;
8081
@dynamic supportsVersioning;
81-
@dynamic supportsInfinitePropfind;
8282

8383
#pragma mark - Sharing
8484
@dynamic sharingAPIEnabled;
@@ -245,6 +245,11 @@ - (NSString *)davChunkingVersion
245245
return (OCTypedCast(_capabilities[@"dav"][@"reports"], NSArray));
246246
}
247247

248+
- (OCCapabilityBool)davPropfindSupportsDepthInfinity
249+
{
250+
return (OCTypedCast(_capabilities[@"dav"][@"propfind"][@"depth_infinity"], NSNumber));
251+
}
252+
248253
#pragma mark - TUS
249254
- (BOOL)tusSupported
250255
{
@@ -344,12 +349,6 @@ - (OCCapabilityBool)supportsVersioning
344349
return (OCTypedCast(_capabilities[@"files"][@"versioning"], NSNumber));
345350
}
346351

347-
- (OCCapabilityBool)supportsInfinitePropfind
348-
{
349-
// Prepared for future server-side capability
350-
return (nil);
351-
}
352-
353352
#pragma mark - Sharing
354353
- (OCCapabilityBool)sharingAPIEnabled
355354
{

ownCloudSDK/Core/FileProvider/OCCore+FileProvider.m

+13-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,21 @@ - (void)retrieveItemFromDatabaseForLocalID:(OCLocalID)localID completionHandler:
3030
{
3131
[self queueBlock:^{
3232
OCSyncExec(cacheItemRetrieval, {
33-
[self.vault.database retrieveCacheItemForLocalID:localID completionHandler:^(OCDatabase *db, NSError *error, OCSyncAnchor syncAnchor, OCItem *item) {
34-
completionHandler(error, syncAnchor, item);
33+
OCDatabase *database = self.vault.database;
3534

35+
if ((database != nil) && database.isOpened)
36+
{
37+
[self.vault.database retrieveCacheItemForLocalID:localID completionHandler:^(OCDatabase *db, NSError *error, OCSyncAnchor syncAnchor, OCItem *item) {
38+
completionHandler(error, syncAnchor, item);
39+
40+
OCSyncExecDone(cacheItemRetrieval);
41+
}];
42+
}
43+
else
44+
{
45+
completionHandler(nil, nil, nil);
3646
OCSyncExecDone(cacheItemRetrieval);
37-
}];
47+
}
3848
});
3949
}];
4050
}

ownCloudSDK/Core/ItemList/OCCore+ItemList.h

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818

1919
#import "OCCore.h"
20+
#import "OCLockManager.h"
21+
#import "OCLockRequest.h"
2022

2123
NS_ASSUME_NONNULL_BEGIN
2224

@@ -40,6 +42,9 @@ NS_ASSUME_NONNULL_BEGIN
4042
- (void)scheduleUpdateScanForPath:(OCPath)path waitForNextQueueCycle:(BOOL)waitForNextQueueCycle;
4143
- (void)recoverPendingUpdateJobs;
4244

45+
- (void)coordinatedScanForChanges;
46+
- (void)shutdownCoordinatedScanForChanges;
47+
4348
@end
4449

4550
@interface OCCore (ItemListInternal)
@@ -48,4 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
4853

4954
extern OCActivityIdentifier OCActivityIdentifierPendingServerScanJobsSummary; //!< The activity reporting the progress of background checks for updates
5055

56+
extern OCKeyValueStoreKey OCKeyValueStoreKeyCoreUpdateScheduleRecord;
57+
extern OCLockResourceIdentifier OCLockResourceIdentifierCoreUpdateScan;
58+
5159
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)