Skip to content

Commit

Permalink
[milestone/11.7.2] Version 11.8 (#89)
Browse files Browse the repository at this point in the history
* - 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
  • Loading branch information
felix-schwarz committed Nov 30, 2021
1 parent 6417702 commit 1093eca
Show file tree
Hide file tree
Showing 38 changed files with 1,344 additions and 90 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,16 @@
## 11.8 version
- Infinite PROPFIND: add support for dav > propfind > depth_infinity capability
- OCLocale: modular localization system replacing direct system localization calls, allowing overrides via MDM and Branding.plist, adding variable support
- 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
- OCSQLiteDB: disable statement caching in minimum memory configuration
- Browser Session Class: add AWBrowser to simplify configuration for AirWatch browser
- 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

## 11.7.1 version

- support for streaming, infinite PROPFIND to prepopulate accounts and speed up initial discovery
Expand Down
64 changes: 64 additions & 0 deletions ownCloudSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

@@ -0,0 +1,27 @@
//
// OCAuthenticationBrowserSessionAWBrowser.h
// ownCloudSDK
//
// Created by Felix Schwarz on 23.09.21.
// Copyright © 2021 ownCloud GmbH. All rights reserved.
//

/*
* Copyright (C) 2021, ownCloud GmbH.
*
* This code is covered by the GNU Public License Version 3.
*
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
* 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>.
*
*/

#import <ownCloudSDK/ownCloudSDK.h>

NS_ASSUME_NONNULL_BEGIN

@interface OCAuthenticationBrowserSessionAWBrowser : OCAuthenticationBrowserSessionCustomScheme

@end

NS_ASSUME_NONNULL_END
@@ -0,0 +1,33 @@
//
// OCAuthenticationBrowserSessionAWBrowser.m
// ownCloudSDK
//
// Created by Felix Schwarz on 23.09.21.
// Copyright © 2021 ownCloud GmbH. All rights reserved.
//

/*
* Copyright (C) 2021, ownCloud GmbH.
*
* This code is covered by the GNU Public License Version 3.
*
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
* 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>.
*
*/

#import "OCAuthenticationBrowserSessionAWBrowser.h"

@implementation OCAuthenticationBrowserSessionAWBrowser

- (NSString *)plainCustomScheme
{
return (@"awb");
}

- (NSString *)secureCustomScheme
{
return (@"awbs");
}

@end
3 changes: 2 additions & 1 deletion ownCloudSDK/Authentication/OCAuthenticationMethod.m
Expand Up @@ -342,7 +342,8 @@ + (OCClassSettingsMetadataCollection)classSettingsMetadata
@"operating-system" : @"Use ASWebAuthenticationSession for browser sessions.",
@"UIWebView" : @"Use UIWebView for browser sessions. Requires compilation with `OC_FEATURE_AVAILABLE_UIWEBVIEW_BROWSER_SESSION=1` preprocessor flag.",
@"CustomScheme" : @"Replace http and https with custom schemes to delegate browser sessions to a different app.",
@"MIBrowser" : @"Replace `http` with `mibrowser` and `https` with `mibrowsers` to delegate browser sessions to the MobileIron browser."
@"MIBrowser" : @"Replace `http` with `mibrowser` and `https` with `mibrowsers` to delegate browser sessions to the MobileIron browser.",
@"AWBrowser" : @"Replace `http` with `awb` and `https` with `awbs` to delegate browser sessions to the AirWatch browser."
},
OCClassSettingsMetadataKeyCategory : @"Authentication"
},
Expand Down
2 changes: 1 addition & 1 deletion ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m
Expand Up @@ -626,7 +626,7 @@ - (void)_refreshTokenForConnection:(OCConnection *)connection availabilityHandle
{
__weak OCAuthenticationMethodOAuth2 *weakSelf = self;

OCLockRequest *lockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[NSString stringWithFormat:@"authentication-data-update:%@", connection.bookmark.uuid] acquiredHandler:^(NSError * _Nullable error, OCLock * _Nullable lock) {
OCLockRequest *lockRequest = [[OCLockRequest alloc] initWithResourceIdentifier:[NSString stringWithFormat:@"authentication-data-update:%@", connection.bookmark.uuid.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
Expand Down
2 changes: 1 addition & 1 deletion ownCloudSDK/Connection/Capabilities/OCCapabilities.h
Expand Up @@ -55,6 +55,7 @@ typedef NSNumber* OCCapabilityBool;
#pragma mark - DAV
@property(readonly,nullable,nonatomic) NSString *davChunkingVersion;
@property(readonly,nullable,nonatomic) NSArray<NSString *> *davReports;
@property(readonly,nullable,nonatomic) OCCapabilityBool davPropfindSupportsDepthInfinity;

#pragma mark - TUS
@property(readonly,nonatomic) BOOL tusSupported;
Expand All @@ -73,7 +74,6 @@ typedef NSNumber* OCCapabilityBool;
@property(readonly,nullable,nonatomic) NSArray<NSString *> *blacklistedFiles;
@property(readonly,nullable,nonatomic) OCCapabilityBool supportsUndelete;
@property(readonly,nullable,nonatomic) OCCapabilityBool supportsVersioning;
@property(readonly,nullable,nonatomic) OCCapabilityBool supportsInfinitePropfind;

#pragma mark - Sharing
@property(readonly,nullable,nonatomic) OCCapabilityBool sharingAPIEnabled;
Expand Down
13 changes: 6 additions & 7 deletions ownCloudSDK/Connection/Capabilities/OCCapabilities.m
Expand Up @@ -60,6 +60,7 @@ @implementation OCCapabilities
#pragma mark - DAV
@dynamic davChunkingVersion;
@dynamic davReports;
@dynamic davPropfindSupportsDepthInfinity;

#pragma mark - TUS
@dynamic tusSupported;
Expand All @@ -78,7 +79,6 @@ @implementation OCCapabilities
@dynamic blacklistedFiles;
@dynamic supportsUndelete;
@dynamic supportsVersioning;
@dynamic supportsInfinitePropfind;

#pragma mark - Sharing
@dynamic sharingAPIEnabled;
Expand Down Expand Up @@ -245,6 +245,11 @@ - (NSString *)davChunkingVersion
return (OCTypedCast(_capabilities[@"dav"][@"reports"], NSArray));
}

- (OCCapabilityBool)davPropfindSupportsDepthInfinity
{
return (OCTypedCast(_capabilities[@"dav"][@"propfind"][@"depth_infinity"], NSNumber));
}

#pragma mark - TUS
- (BOOL)tusSupported
{
Expand Down Expand Up @@ -344,12 +349,6 @@ - (OCCapabilityBool)supportsVersioning
return (OCTypedCast(_capabilities[@"files"][@"versioning"], NSNumber));
}

- (OCCapabilityBool)supportsInfinitePropfind
{
// Prepared for future server-side capability
return (nil);
}

#pragma mark - Sharing
- (OCCapabilityBool)sharingAPIEnabled
{
Expand Down
16 changes: 13 additions & 3 deletions ownCloudSDK/Core/FileProvider/OCCore+FileProvider.m
Expand Up @@ -30,11 +30,21 @@ - (void)retrieveItemFromDatabaseForLocalID:(OCLocalID)localID completionHandler:
{
[self queueBlock:^{
OCSyncExec(cacheItemRetrieval, {
[self.vault.database retrieveCacheItemForLocalID:localID completionHandler:^(OCDatabase *db, NSError *error, OCSyncAnchor syncAnchor, OCItem *item) {
completionHandler(error, syncAnchor, item);
OCDatabase *database = self.vault.database;

if ((database != nil) && database.isOpened)
{
[self.vault.database retrieveCacheItemForLocalID:localID completionHandler:^(OCDatabase *db, NSError *error, OCSyncAnchor syncAnchor, OCItem *item) {
completionHandler(error, syncAnchor, item);

OCSyncExecDone(cacheItemRetrieval);
}];
}
else
{
completionHandler(nil, nil, nil);
OCSyncExecDone(cacheItemRetrieval);
}];
}
});
}];
}
Expand Down
8 changes: 8 additions & 0 deletions ownCloudSDK/Core/ItemList/OCCore+ItemList.h
Expand Up @@ -17,6 +17,8 @@
*/

#import "OCCore.h"
#import "OCLockManager.h"
#import "OCLockRequest.h"

NS_ASSUME_NONNULL_BEGIN

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

- (void)coordinatedScanForChanges;
- (void)shutdownCoordinatedScanForChanges;

@end

@interface OCCore (ItemListInternal)
Expand All @@ -48,4 +53,7 @@ NS_ASSUME_NONNULL_BEGIN

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

extern OCKeyValueStoreKey OCKeyValueStoreKeyCoreUpdateScheduleRecord;
extern OCLockResourceIdentifier OCLockResourceIdentifierCoreUpdateScan;

NS_ASSUME_NONNULL_END

0 comments on commit 1093eca

Please sign in to comment.