Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[milestone/12.0.4] Milestone 12.0.4 #1272

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
99608c9
- CreateDocumentAction: make availability dependant on OCAppProvider.…
felix-schwarz Jun 28, 2023
4b9b483
- add support for TUS upload mtime metadata header (fixing #1227)
felix-schwarz Jul 3, 2023
4cee115
- FileProviderExtension: add additional debug output for enumerator
felix-schwarz Jul 4, 2023
ce2ab28
FileProvider:
felix-schwarz Jul 10, 2023
bc1327a
- FIleProviderContentEnumerator: add/refine more debug logging
felix-schwarz Jul 10, 2023
59736f7
- bump version to 12.0.3 and build number to 271
felix-schwarz Jul 10, 2023
5313248
removed the logo label from the sidebar navigation bar to have more s…
hosy Jul 11, 2023
9cb4d8c
- update SDK to fix https://github.com/owncloud/enterprise/issues/5811
felix-schwarz Jul 11, 2023
a95bb44
- fix #1254
felix-schwarz Jul 17, 2023
e0d8c18
Example JSON + README (#1255)
michaelstingl Jul 20, 2023
d00be67
Cleanup of Theming folder (#1260)
michaelstingl Jul 20, 2023
5d54b5d
- FileProvider: fix enumerator queue completion slowdown/blocking
felix-schwarz Jul 20, 2023
e14352c
- show vendor label in the sidebar if app is unbranded
hosy Jul 24, 2023
0571ec7
- FileProvider cleanup and additional debug logging
felix-schwarz Jul 24, 2023
9a3e5ef
- BottomButtonBar: avoid collapse of selectButton (fixes https://gith…
felix-schwarz Jul 26, 2023
fed83fd
- add background image to welcome screen
felix-schwarz Jul 26, 2023
b4c5320
- change welcome screen background default color from dark to bright
felix-schwarz Jul 26, 2023
3e7198b
- BookmarkViewController: add .bookmarkEditor CSS selector
felix-schwarz Jul 26, 2023
e596ab7
Merge branch 'fix/sidebar-logo' into experimental/branding
felix-schwarz Jul 26, 2023
3346666
- ThemeCSS: add support for $cssSelector.cssProperty
felix-schwarz Jul 26, 2023
6d8def3
Assets.xcassets/AppIcon.appiconset generated with fastlane + welcome …
michaelstingl Jul 26, 2023
abe25cb
- change welcome screen background default color from dark to bright
felix-schwarz Jul 26, 2023
1ea7a36
Assets.xcassets/AppIcon.appiconset generated with fastlane
michaelstingl Jul 26, 2023
fa5b296
rename vanilla appiconset again for fastlane changes
michaelstingl Jul 26, 2023
c625bef
- ThemeCSS+SystemColors: add convenience methods to easily add CSS re…
felix-schwarz Jul 26, 2023
f0e779b
Merge branch 'experimental/branding-css-syscolors' into experimental/…
felix-schwarz Jul 26, 2023
5c7db31
Vanilla: change welcome screen background default color from bright t…
michaelstingl Jul 26, 2023
e9a1183
- BookmarkViewController:
felix-schwarz Jul 27, 2023
a9ca511
- BookmarkViewController: remove table view background image from bra…
felix-schwarz Jul 27, 2023
ded3a57
- RoundCornerBackgroundView: fix bug in sizeThatFills()
felix-schwarz Jul 27, 2023
95522b0
- DisplayViewController: handle nil OCQueryChangeSet.queryResult (sho…
felix-schwarz Jul 31, 2023
c4e0d89
fixed missing translation strings or localized function
hosy Jul 31, 2023
de9ab8f
Merge branch 'milestone/12.0.3' of https://github.com/owncloud/ios-ap…
hosy Jul 31, 2023
ba99ed1
fixed bug in sidebar: label color got the same color as background co…
hosy Aug 2, 2023
7986210
- FileProviderExtension: add safeguards around `[NSError fileProvider…
felix-schwarz Aug 4, 2023
9a3f828
[fix/overlapping-sharing-buttons] Overlapping Sharing Buttons (#1248)
hosy Aug 4, 2023
7c7115b
[fix/passcode-device-enforced] MDM Parameter - Enforce Passcode Setup…
hosy Aug 4, 2023
f5808db
[fix/sidebar-logo] Sidebar Logo (#1247)
hosy Aug 4, 2023
2a2aeea
[translation-sync] Translation sync (#1250)
hosy Aug 7, 2023
119383b
Merge branch 'milestone/12.0.3' into experimental/branding
hosy Aug 7, 2023
fe17e67
- update SDK
felix-schwarz Aug 8, 2023
f6ef895
- update SDK to update error message for OCErrorAuthorizationNoMethod…
felix-schwarz Aug 9, 2023
b4f63f3
- add "An error occurred" to Localizable.strings
felix-schwarz Aug 9, 2023
c41b0cc
- SDK update with updated strings
felix-schwarz Aug 21, 2023
0a47517
GH workflows:
felix-schwarz Aug 23, 2023
a4469ae
- GitHub workflows: move new GH workflow out of workflows folder to a…
felix-schwarz Aug 23, 2023
16c136d
Translation sync (#1269)
felix-schwarz Aug 23, 2023
c56020d
- update ios-sdk to gain ocstringstool
felix-schwarz Aug 24, 2023
faab586
- update release notes for 12.0.3
felix-schwarz Aug 24, 2023
b56d60e
Merge branch 'master' into milestone/12.0.3
felix-schwarz Aug 24, 2023
069feb8
- NSObject+ThemeApplication: fix wrong label colors for ThemeCSSLabel…
felix-schwarz Aug 28, 2023
d511896
- AppRootViewController + InitialSetupViewController: move initial se…
felix-schwarz Aug 28, 2023
a455ce1
- fix iOS 17 initial setup color issue
felix-schwarz Aug 28, 2023
9662483
- address https://github.com/owncloud/core/issues/40953#issuecomment-…
felix-schwarz Aug 29, 2023
1932993
- fix: rename of a bookmark is not always reflected in the account list
felix-schwarz Aug 29, 2023
bf5a832
- BottomButtonBar: adapt layout dynamically to size class, placing th…
felix-schwarz Aug 29, 2023
72e9873
- ClientSidebarViewController: properly initialize accountsController…
felix-schwarz Aug 29, 2023
40dfc92
- fix SwiftLint warnings
felix-schwarz Aug 29, 2023
b599c76
- BookmarkViewController: add modern password manager integration to …
felix-schwarz Sep 4, 2023
427f6cb
- SDK update: OCHTTPPipeline: move metrics logging to response loggin…
felix-schwarz Sep 4, 2023
6a62238
- SDK update for better formatted metrics line
felix-schwarz Sep 4, 2023
14b7ccc
SDK rebase
felix-schwarz Sep 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/normalize-strings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Normalize .strings file encoding
# This workflow is triggered on pushes to the repository.
on:
push:
branches:
- fix/*
- feature/*
- milestone/*
- translation-sync

jobs:
build:
runs-on: macos-latest
name: Normalize .strings file encoding
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Xcode version
run: /usr/bin/xcodebuild -version
- name: Normalize .strings files to UTF-8
run: ./normalizestrings.sh
working-directory: ./tools/normalizestrings/
- name: Commit files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Normalized Localizable.strings encoding (UTF-8)
file_pattern: '*.strings'
34 changes: 6 additions & 28 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ platform :ios do
)

puts("Build EMM iOS App…")
# Set EMM App-Icon for App Build
sh "mv ../ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/ ../ownCloud/Resources/Assets.xcassets/AppIcon-regular.appiconset/"
sh "mv ../ownCloud/Resources/Assets.xcassets/AppIcon-emm.appiconset/ ../ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/"
# Moving all EMM resources to the correct place
sh "cp -R ../ownCloud/Resources/Theming/com.owncloud.ios-app.emm/* ../ownCloud/Resources/Theming/"

# Build App
owncloud_emm_build()
Expand Down Expand Up @@ -222,30 +221,9 @@ platform :ios do

puts("Build ownCloud Online iOS App…")

# Moving the ownCloud.online Branding.plist to the correct place
sh "mv ../ownCloud/Resources/Theming/Branding.plist ../ownCloud/Resources/Theming/Branding-regular.plist"
sh "mv ../ownCloud/Resources/Theming/Branding-owncloud-online.plist ../ownCloud/Resources/Theming/Branding.plist"

# Set ownCloud.online Splashscreen Background for App Build
sh "mv ../ownCloud/Resources/Theming/branding-splashscreen-background.png ../ownCloud/Resources/Theming/branding-splashscreen-background-regular.png"
sh "mv ../ownCloud/Resources/Theming/branding-splashscreen-background-owncloud-online.png ../ownCloud/Resources/Theming/branding-splashscreen-background.png"

# Set ownCloud.online Splashscreen Logo for App Build
sh "mv ../ownCloud/Resources/Theming/branding-splashscreen.png ../ownCloud/Resources/Theming/branding-splashscreen-regular.png"
sh "mv ../ownCloud/Resources/Theming/branding-splashscreen-owncloud-online.png ../ownCloud/Resources/Theming/branding-splashscreen.png"

# Set ownCloud.online Branded Login Logo for App Build
sh "mv ../ownCloud/Resources/Theming/branding-login-logo.png ../ownCloud/Resources/Theming/branding-login-logo-regular.png"
sh "mv ../ownCloud/Resources/Theming/branding-login-logo-owncloud-online.png ../ownCloud/Resources/Theming/branding-login-logo.png"

# Set ownCloud.online Branded Login Background for App Build
sh "mv ../ownCloud/Resources/Theming/branding-login-background.png ../ownCloud/Resources/Theming/branding-login-background-regular.png"
sh "mv ../ownCloud/Resources/Theming/branding-login-background-owncloud-online.png ../ownCloud/Resources/Theming/branding-login-background.png"

# Set ownCloud.online App-Icon for App Build
sh "mv ../ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/ ../ownCloud/Resources/Assets.xcassets/AppIcon-regular.appiconset/"
sh "mv ../ownCloud/Resources/Assets.xcassets/AppIcon-ownCloud-online.appiconset/ ../ownCloud/Resources/Assets.xcassets/AppIcon.appiconset/"

# Moving all ownCloud.online resources to the correct place
sh "cp -R ../ownCloud/Resources/Theming/online.owncloud.ios-app/* ../ownCloud/Resources/Theming/"

# Build App
owncloud_online_build()

Expand Down Expand Up @@ -424,7 +402,7 @@ end
end

lane :generate_appicon do
iconPath = "ownCloud/Resources/Theming/icon-1024.png"
iconPath = "ownCloud/Resources/Theming/branding-icon.png"
if File.exist?("../" + iconPath)
appicon(
appicon_image_file: iconPath,
Expand Down
Binary file added fastlane/screenshots/bg_BG/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/bg_BG/title.strings
Binary file not shown.
Binary file modified fastlane/screenshots/de-DE/keyword.strings
Binary file not shown.
Binary file modified fastlane/screenshots/de-DE/title.strings
Binary file not shown.
2 changes: 1 addition & 1 deletion ios-sdk
Submodule ios-sdk updated 89 files
+28 −0 .github/workflows.inactive/normalizestrings.yml
+12 −0 ownCloudSDK.xcodeproj/project.pbxproj
+5 −0 ownCloudSDK/App Providers/OCAppProvider.h
+22 −7 ownCloudSDK/App Providers/OCAppProvider.m
+11 −4 ownCloudSDK/Connection/OCConnection+Upload.m
+2 −4 ownCloudSDK/Connection/OCConnection+Users.m
+11 −7 ownCloudSDK/Core/ItemList/OCCore+ItemList.m
+6 −4 ownCloudSDK/Core/OCCore+ItemUpdates.m
+9 −8 ownCloudSDK/Core/OCCore.m
+1 −1 ownCloudSDK/Core/Resources/URL-based/DriveItems/OCResourceSourceDriveItems.m
+3 −1 ownCloudSDK/Core/Resources/URL-based/OCResourceSourceURL.h
+6 −1 ownCloudSDK/Core/Resources/URL-based/OCResourceSourceURL.m
+20 −1 ownCloudSDK/Core/Resources/URL-based/URLItems/OCResourceSourceURLItems.m
+2 −1 ownCloudSDK/Core/Sharing/OCShareQuery.m
+1 −0 ownCloudSDK/Core/Sync/Actions/Download/OCSyncActionDownload.m
+1 −1 ownCloudSDK/Data Sources/Sources/Array Backed/OCDataSourceArray.h
+11 −0 ownCloudSDK/Data Sources/Sources/Array Backed/OCDataSourceArray.m
+1 −1 ownCloudSDK/Data Sources/Sources/Mapped/OCDataSourceMapped.h
+2 −2 ownCloudSDK/Errors/NSError+OCError.m
+6 −5 ownCloudSDK/HTTP/Pipeline/OCHTTPPipeline.m
+2 −0 ownCloudSDK/HTTP/Pipeline/OCHTTPPipelineTaskMetrics.h
+4 −0 ownCloudSDK/HTTP/Pipeline/OCHTTPPipelineTaskMetrics.m
+4 −0 ownCloudSDK/Query/OCQuery+Internal.h
+34 −0 ownCloudSDK/Query/OCQuery+Internal.m
+5 −1 ownCloudSDK/Query/OCQuery.h
+26 −0 ownCloudSDK/Query/OCQuery.m
+14 −10 ownCloudSDK/Query/OCQueryChangeSet.h
+2 −1 ownCloudSDK/Resource Management/OCBookmarkManager.m
+ ownCloudSDK/Resources/ar.lproj/Localizable.strings
+485 −0 ownCloudSDK/Resources/bg_BG.lproj/Localizable.strings
+1 −1 ownCloudSDK/Resources/cs.lproj/Localizable.strings
+485 −0 ownCloudSDK/Resources/de-DE.lproj/Localizable.strings
+ ownCloudSDK/Resources/de.lproj/Localizable.strings
+ ownCloudSDK/Resources/de_CH.lproj/Localizable.strings
+ ownCloudSDK/Resources/el.lproj/Localizable.strings
+ ownCloudSDK/Resources/en-GB.lproj/Localizable.strings
+2 −2 ownCloudSDK/Resources/en.lproj/Localizable.strings
+ ownCloudSDK/Resources/es.lproj/Localizable.strings
+ ownCloudSDK/Resources/eu.lproj/Localizable.strings
+ ownCloudSDK/Resources/fr.lproj/Localizable.strings
+ ownCloudSDK/Resources/gl.lproj/Localizable.strings
+ ownCloudSDK/Resources/he.lproj/Localizable.strings
+ ownCloudSDK/Resources/is.lproj/Localizable.strings
+372 −90 ownCloudSDK/Resources/ko.lproj/Localizable.strings
+ ownCloudSDK/Resources/lt_LT.lproj/Localizable.strings
+1 −1 ownCloudSDK/Resources/mk.lproj/Localizable.strings
+1 −1 ownCloudSDK/Resources/nb-NO.lproj/Localizable.strings
+1 −1 ownCloudSDK/Resources/nn-NO.lproj/Localizable.strings
+ ownCloudSDK/Resources/pt-BR.lproj/Localizable.strings
+ ownCloudSDK/Resources/pt-PT.lproj/Localizable.strings
+ ownCloudSDK/Resources/ru.lproj/Localizable.strings
+ ownCloudSDK/Resources/sq.lproj/Localizable.strings
+ ownCloudSDK/Resources/th-TH.lproj/Localizable.strings
+ ownCloudSDK/Resources/tr.lproj/Localizable.strings
+ ownCloudSDK/Resources/zh-Hans.lproj/Localizable.strings
+ ownCloudSDK/Resources/zh_TW.lproj/Localizable.strings
+2 −0 ownCloudSDK/TUS/NSString+TUSMetadata.h
+1 −1 ownCloudSDK/TUS/NSString+TUSMetadata.m
+0 −6 ownCloudUI/Certificate Metadata/OCCertificate+OpenSSL.m
+6 −0 ownCloudUI/Certificate Metadata/OCCertificateViewController.m
+127 −0 ownCloudUI/Certificate Metadata/OpenSSL license/OpenSSL.LICENSE
+ ownCloudUI/Resources/ar.lproj/Localizable.strings
+52 −0 ownCloudUI/Resources/bg_BG.lproj/Localizable.strings
+ ownCloudUI/Resources/de-DE.lproj/Localizable.strings
+ ownCloudUI/Resources/de.lproj/Localizable.strings
+ ownCloudUI/Resources/de_CH.lproj/Localizable.strings
+ ownCloudUI/Resources/el.lproj/Localizable.strings
+ ownCloudUI/Resources/en-GB.lproj/Localizable.strings
+ ownCloudUI/Resources/es.lproj/Localizable.strings
+ ownCloudUI/Resources/eu.lproj/Localizable.strings
+ ownCloudUI/Resources/fr.lproj/Localizable.strings
+ ownCloudUI/Resources/gl.lproj/Localizable.strings
+ ownCloudUI/Resources/he.lproj/Localizable.strings
+ ownCloudUI/Resources/is.lproj/Localizable.strings
+41 −35 ownCloudUI/Resources/ko.lproj/Localizable.strings
+ ownCloudUI/Resources/pt-BR.lproj/Localizable.strings
+ ownCloudUI/Resources/pt-PT.lproj/Localizable.strings
+ ownCloudUI/Resources/ru.lproj/Localizable.strings
+ ownCloudUI/Resources/sq.lproj/Localizable.strings
+ ownCloudUI/Resources/th-TH.lproj/Localizable.strings
+ ownCloudUI/Resources/th_TH.lproj/Localizable.strings
+ ownCloudUI/Resources/tr.lproj/Localizable.strings
+ ownCloudUI/Resources/zh-Hans.lproj/Localizable.strings
+ ownCloudUI/Resources/zh_TW.lproj/Localizable.strings
+18 −0 tools/normalizestrings/normalizestrings.sh
+12 −0 tools/ocstringstool/build_tool.sh
+291 −0 tools/ocstringstool/ocstringstool.xcodeproj/project.pbxproj
+7 −0 tools/ocstringstool/ocstringstool.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+79 −0 tools/ocstringstool/ocstringstool/main.swift
2 changes: 2 additions & 0 deletions ownCloud File Provider/FileProviderContentEnumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
{
NSMutableArray <FileProviderEnumeratorObserver *> *_enumerationObservers;
NSMutableArray <FileProviderEnumeratorObserver *> *_changeObservers;

NSHashTable<OCQuery *> *_didReturnAnyContentQueries;
}

@property(nonatomic,readonly,class) OCAsyncSequentialQueue *queue;
Expand Down
100 changes: 83 additions & 17 deletions ownCloud File Provider/FileProviderContentEnumerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ - (instancetype)initWithVFSCore:(OCVFSCore *)vfsCore containerItemIdentifier:(OC
_enumerationObservers = [NSMutableArray new];
_changeObservers = [NSMutableArray new];

_didReturnAnyContentQueries = [NSHashTable weakObjectsHashTable];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_displaySettingsChanged:) name:DisplaySettingsChanged object:nil];
}

Expand Down Expand Up @@ -217,59 +219,85 @@ - (void)invalidate
- (void)requestContentWithErrorHandler:(void(^)(NSError *))errorHandler contentConsumer:(void(^)(OCVFSContent *))contentConsumer observerQueuer:(BOOL(^)(dispatch_block_t completionHandler))observerQueuer
{
__weak FileProviderContentEnumerator *weakSelf = self;
OCVFSItemID containerItemIdentifier = _containerItemIdentifier;
NSString *contentRequestUUID = [containerItemIdentifier stringByAppendingFormat:@"#%@", NSUUID.UUID.UUIDString];

OCLogDebug(@"[QUEUE] Queuing content request %@", contentRequestUUID);

[FileProviderContentEnumerator.queue async:^(dispatch_block_t _Nonnull completionHandler) {
FileProviderContentEnumerator *strongSelf = weakSelf;

OCWLogDebug(@"[START] Starting content request %@", contentRequestUUID);

// Add completion handler call debugging
completionHandler = ^{
OCWLogDebug(@"[CMPHL] Completion handler called for request %@, stack trace: %@", contentRequestUUID, NSThread.callStackSymbols);
completionHandler();
};

if (strongSelf == nil) {
OCWLogDebug(@"[CMPLT] Content Enumerator deallocated before content could be returned for %@", contentRequestUUID);
errorHandler(OCErrorWithDescription(OCErrorInternal, @"Content Enumerator deallocated before content could be returned"));

completionHandler();
return;
}

[strongSelf.vfsCore provideContentForContainerItemID:strongSelf->_containerItemIdentifier changesFromSyncAnchor:nil completionHandler:^(NSError * _Nullable error, OCVFSContent * _Nullable content) {
[strongSelf.vfsCore provideContentForContainerItemID:containerItemIdentifier changesFromSyncAnchor:nil completionHandler:^(NSError * _Nullable error, OCVFSContent * _Nullable content) {
OCWLogDebug(@"[HAND1] Handling response for content request %@", contentRequestUUID);

dispatch_async(FileProviderContentEnumerator.dispatchQueue, ^{
FileProviderContentEnumerator *strongSelf = weakSelf;

OCWLogDebug(@"[HAND2] Handling response for content request %@", contentRequestUUID);

if (strongSelf == nil) {
OCWLogDebug(@"[ERROR] Content Enumerator deallocated before content could be returned for %@", contentRequestUUID);
errorHandler(OCErrorWithDescription(OCErrorInternal, @"Content Enumerator deallocated before content could be returned"));

completionHandler();
return;
}

if (error != nil)
{
OCWLogDebug(@"[ERROR] Content Enumerator VFS response error %@ for %@", error, contentRequestUUID);
errorHandler(error);
completionHandler();
}
else
{
if (content.isSnapshot)
{
// Content is a snapshot, so there's no need to keep the content around - it can be sent now
OCWLogDebug(@"[CMPLT] Content Enumerator VFS snapshot response for %@", contentRequestUUID);
contentConsumer(content);
completionHandler();
}
else
{
// Content is self-updating, so we can send it
if (strongSelf.content != nil)
{
// Content already available
OCWLogDebug(@"[CMPLT] Content Enumerator VFS immediately available content response for %@", contentRequestUUID);
contentConsumer(strongSelf.content);
completionHandler();
}
else
{
if (observerQueuer(completionHandler))
{
strongSelf.content = content;
}
else
// Content to be provided by observer
OCWLogDebug(@"[REQST] Content Enumerator VFS provided asynchronously for %@", contentRequestUUID);
strongSelf.content = content; // effectively sets it to nil, since this can only be reached following (strongSelf.content == nil)

if (!observerQueuer(nil))
{
strongSelf.content = content;
completionHandler();
// No observer available - unexpected, so complete with an error
OCWLogDebug(@"[ERROR] No content observer available for %@", contentRequestUUID);
errorHandler(OCErrorWithDescription(OCErrorInternal, @"No content observer available"));
}
}
}
}

completionHandler();
});
}];
}];
Expand Down Expand Up @@ -542,8 +570,11 @@ - (void)setContent:(OCVFSContent *)content
#pragma mark - Content distribution
- (BOOL)provideItemsToEnumerationObserver:(id<NSFileProviderEnumerationObserver>)enumerationObserver fromContent:(OCVFSContent *)content
{
if (((content.query.state == OCQueryStateContentsFromCache) || ((content.query.state == OCQueryStateWaitingForServerReply) && (content.query.queryResults.count > 0)) || (content.query.state == OCQueryStateIdle))
|| ((content.query == nil) && (content != nil)))
if (( (content.query.state == OCQueryStateContentsFromCache) ||
((content.query.state == OCQueryStateWaitingForServerReply) && (content.query.queryResults.count > 0)) ||
(content.query.state == OCQueryStateIdle)
) ||
((content.query == nil) && (content != nil)))
{
NSArray <OCItem *> *queryResults = content.query.queryResults;
OCBookmarkUUIDString bookmarkUUIDString = content.core.bookmark.uuid.UUIDString;
Expand All @@ -553,6 +584,11 @@ - (BOOL)provideItemsToEnumerationObserver:(id<NSFileProviderEnumerationObserver>
item.bookmarkUUID = bookmarkUUIDString;
}

if (content.query != nil)
{
[_didReturnAnyContentQueries addObject:content.query];
}

OCLogDebug(@"##### PROVIDE ITEMS TO %ld --ENUMERATION-- OBSERVER %@ FOR %@: %@", _enumerationObservers.count, enumerationObserver, content.query.queryLocation.path, queryResults);

dispatch_async(dispatch_get_main_queue(), ^{
Expand Down Expand Up @@ -587,6 +623,11 @@ - (BOOL)provideItemsForChangeObserver:(id<NSFileProviderChangeObserver>)changeOb
item.bookmarkUUID = bookmarkUUIDString;
}

if (content.query != nil)
{
[_didReturnAnyContentQueries addObject:content.query];
}

NSFileProviderSyncAnchor syncAnchor = [content.core.latestSyncAnchor syncAnchorData];

dispatch_async(dispatch_get_main_queue(), ^{
Expand All @@ -598,14 +639,14 @@ - (BOOL)provideItemsForChangeObserver:(id<NSFileProviderChangeObserver>)changeOb
}

#pragma mark - OCQuery delegate
- (void)queryHasChangesAvailable:(OCQuery *)query
- (void)_updateFromQuery:(OCQuery *)query
{
OCLogDebug(@"##### Query for %@ has changes. Query state: %lu, SinceSyncAnchor: %@, Changes available: %d", query.queryLocation.path, (unsigned long)query.state, query.querySinceSyncAnchor, query.hasChangesAvailable);

if ( (query.state == OCQueryStateContentsFromCache) ||
((query.state == OCQueryStateWaitingForServerReply) && (query.queryResults.count > 0)) ||
(query.state == OCQueryStateIdle))
{
OCLogDebug(@"##### Serving query %@ for %@ content. Query state: %lu, SinceSyncAnchor: %@, Changes available: %d", query, query.queryLocation.path, (unsigned long)query.state, query.querySinceSyncAnchor, query.hasChangesAvailable);

dispatch_async(FileProviderContentEnumerator.dispatchQueue, ^{
// Send content to enumeration observers
NSArray<FileProviderEnumeratorObserver *> *enumerationObservers = [self->_enumerationObservers copy];
Expand All @@ -619,7 +660,6 @@ - (void)queryHasChangesAvailable:(OCQuery *)query
}
}


// Send content to change observers
NSArray<FileProviderEnumeratorObserver *> *changeObservers = [self->_changeObservers copy];

Expand All @@ -635,6 +675,32 @@ - (void)queryHasChangesAvailable:(OCQuery *)query
}
}

- (void)queryHasChangesAvailable:(OCQuery *)query
{
OCLogDebug(@"##### Query %@ for %@ has changes. Query state: %lu, SinceSyncAnchor: %@, Changes available: %d", query, query.queryLocation.path, (unsigned long)query.state, query.querySinceSyncAnchor, query.hasChangesAvailable);

[self _updateFromQuery:query];
}

- (void)queryHasChangedState:(OCQuery *)query
{
OCLogDebug(@"##### Query %@ for %@ has changed state. Query state: %lu, SinceSyncAnchor: %@, Changes available: %d", query, query.queryLocation.path, (unsigned long)query.state, query.querySinceSyncAnchor, query.hasChangesAvailable);

BOOL didReturnContentForQueryBefore = [_didReturnAnyContentQueries containsObject:query];
BOOL isEmptyQueryResult = (query.queryResults.count == 0);

// This catches the following special case:
// - query has no results (f.ex. empty folder)
// -> query had no results when returning from the database and waiting for a reply (=> does not provide items to FP)
// -> query returns from PROPFIND and changes state to idle, but still has no results (=> chance that only state changes, no additional call to -queryHasChangesAvailable:, because it has not)
// -> query does not return any results -> Files.app shows spinner indefinitely (=> now, the state change to idle with an empty result set triggers a return of items
if ((query.state == OCQueryStateIdle) && !didReturnContentForQueryBefore && isEmptyQueryResult)
{
OCLogDebug(@"Would have updated %@", query);
// [self _updateFromQuery:query];
}
}

- (void)query:(OCQuery *)query failedWithError:(NSError *)error
{
OCLogDebug(@"### Query failed with error: %@", error);
Expand Down
50 changes: 0 additions & 50 deletions ownCloud File Provider/FileProviderEnumerator.h

This file was deleted.

Loading
Loading