-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow the injection of background URLSession identifier #33
Conversation
WalkthroughThe recent updates across various test files in the CryptomatorCloudAccess project involve transitioning to asynchronous programming using Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (14)
Files not summarized due to errors (1)
Additional comments not posted (57)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (11)
- Sources/CryptomatorCloudAccess/GoogleDrive/GoogleDriveCloudProvider.swift (3 hunks)
- Sources/CryptomatorCloudAccess/OneDrive/OneDriveCloudProvider.swift (1 hunks)
- Sources/CryptomatorCloudAccess/PCloud/PCloudCredential.swift (1 hunks)
- Sources/CryptomatorCloudAccess/WebDAV/WebDAVClient.swift (1 hunks)
- Sources/CryptomatorCloudAccess/WebDAV/WebDAVSession.swift (1 hunks)
- Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat6/VaultFormat6GoogleDriveIntegrationTests.swift (3 hunks)
- Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat6/VaultFormat6OneDriveIntegrationTests.swift (2 hunks)
- Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat7/VaultFormat7GoogleDriveIntegrationTests.swift (3 hunks)
- Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat7/VaultFormat7OneDriveIntegrationTests.swift (2 hunks)
- Tests/CryptomatorCloudAccessIntegrationTests/Google Drive/GoogleDriveCloudProviderIntegrationTests.swift (2 hunks)
- Tests/CryptomatorCloudAccessIntegrationTests/OneDrive/OneDriveCloudProviderIntegrationTests.swift (2 hunks)
Additional comments not posted (17)
Tests/CryptomatorCloudAccessIntegrationTests/Google Drive/GoogleDriveCloudProviderIntegrationTests.swift (2)
28-28
: Ensure that the removal of theuseBackgroundSession
parameter and the direct use ofGoogleDriveCloudProvider(credential: credential)
does not introduce any unintended side effects, especially in terms of session management and identifier uniqueness.
35-35
: Confirm that the updated initialization ofGoogleDriveCloudProvider
without theuseBackgroundSession
parameter is consistent across all test setups and aligns with the new session management strategy.Tests/CryptomatorCloudAccessIntegrationTests/OneDrive/OneDriveCloudProviderIntegrationTests.swift (2)
28-28
: Verify that the removal of theuseBackgroundSession
parameter fromOneDriveCloudProvider
initialization is thoroughly tested to ensure that session management behaves as expected.
35-35
: Ensure that the updated initialization ofOneDriveCloudProvider
without theuseBackgroundSession
parameter is correctly applied in all relevant test cases and aligns with the intended session management improvements.Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat6/VaultFormat6OneDriveIntegrationTests.swift (1)
25-25
: Confirm that the updatedOneDriveCloudProvider
initialization without theuseBackgroundSession
parameter does not impact the functionality of the vault format 6 integration tests with OneDrive.Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat7/VaultFormat7OneDriveIntegrationTests.swift (1)
25-25
: Ensure that the removal of theuseBackgroundSession
parameter in theOneDriveCloudProvider
initialization is compatible with the vault format 7 integration tests and does not introduce any regressions.Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat6/VaultFormat6GoogleDriveIntegrationTests.swift (1)
24-24
: Verify that the removal of theuseBackgroundSession
parameter fromGoogleDriveCloudProvider
initialization is properly tested and does not affect the functionality of vault format 6 integration tests with Google Drive.Tests/CryptomatorCloudAccessIntegrationTests/CryptoDecorator/VaultFormat7/VaultFormat7GoogleDriveIntegrationTests.swift (1)
24-24
: Ensure that the updatedGoogleDriveCloudProvider
initialization without theuseBackgroundSession
parameter is thoroughly evaluated to confirm its compatibility with vault format 7 integration tests.Sources/CryptomatorCloudAccess/PCloud/PCloudCredential.swift (1)
40-50
: The addition of thesessionIdentifier
parameter to thecreateBackgroundClient
function is a critical change for ensuring unique session management in PCloud clients. Confirm that this change is consistently applied wherevercreateBackgroundClient
is used and that the unique session identifiers are correctly generated and managed.Sources/CryptomatorCloudAccess/WebDAV/WebDAVClient.swift (1)
35-37
: The introduction of thesessionIdentifier
parameter to thewithBackgroundSession
function inWebDAVClient
is crucial for unique session management. Ensure that this change is properly integrated and tested across all uses ofWebDAVClient
to guarantee that session identifiers are uniquely managed.Sources/CryptomatorCloudAccess/WebDAV/WebDAVSession.swift (1)
189-190
: Ensure thesessionIdentifier
passed tocreateBackgroundSession
is managed to be unique across different instances to prevent session conflicts.Sources/CryptomatorCloudAccess/OneDrive/OneDriveCloudProvider.swift (2)
22-22
: Ensure theurlSessionConfiguration
passed to theinit
method is properly configured for different use cases, especially for background sessions.
38-38
: Ensure theidentifier
passed towithBackgroundSession
is managed to be unique across different instances to prevent session conflicts.Sources/CryptomatorCloudAccess/GoogleDrive/GoogleDriveCloudProvider.swift (4)
17-18
: LGTM! Using an enum for constants is a clean and effective way to manage static values within the class.
28-35
: Consider adding documentation or comments for theurlSessionConfiguration
parameter to clarify its purpose and guide its correct usage.
38-43
: LGTM! The convenience initializer is a good addition for backward compatibility and ease of use.
46-54
: Great addition with thewithBackgroundSession
method. Ensure the implications of usingsharedContainerIdentifier
, especially in the context of app extensions and shared data, are clearly documented for developers.
0bcee8b
to
4912c34
Compare
4912c34
to
812ad30
Compare
Looking good, just did some minor refactorings, but really no big deal, could've also just left everything as-is. I was just wondering: Can you quickly elaborate, why there were no changes in Dropbox and S3? Is Dropbox foreground-only? But what about S3? There is also a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't quite answered the question for Dropbox and S3 yet, but I wanted to work on an update this week, because more and more OneDrive users are reporting this issue. 😄
This PR adds the ability to inject the unique identifier used by the background
URLSession
for eachCloudProvider
.This is needed since issues appeared in the FileProviderExtension where we tried to use the same credential, which we usually used to make the identifier unique, for multiple vaults. Therefore, it was possible that more than one background URLSession gets created with the same identifier which then results in a failing URLSession.
Previously we could workaround this issue by just cache each
CloudProvider
but it seems like iOS creates now a own process for each domain.Summary by CodeRabbit