* Nextcloud Login Flow: handle non-success status codes
* Update error message to use class name when localized message is null
* Update dav4jvm to get HTTP reason phrases in HttpException
* [WIP] Use Ktor for Nextcloud login flow
- Replace OkHttp with Ktor for HTTP requests
- Update URL handling to use Ktor's `Url` class
- Adjust `postForJson` method to use Ktor's HTTP client
- Refactor URL building logic for login flow initiation
* Use Ktor for Nextcloud login flow
- Migrate to Ktor's ContentNegotiation plugin for JSON handling
- Update dependencies and configuration for Ktor serialization
- Refactor `NextcloudLoginFlow` to use Ktor's JSON serialization
* Add tests
* Allow unit tests that mock/use HttpClient without Conscrypt
* KDoc
* Minor fixes
* Use toUrlOrNull from dav4jvm
* Don't change strings in this PR
* Update dav4jvm and synctools
* Remove the ignore annotation
* Turn inPendingState in to a hot state flow for the test duration
Signed-off-by: Sunik Kupfer <kupfer@bitfire.at>
* Rename methods registering the sync state observer
Signed-off-by: Sunik Kupfer <kupfer@bitfire.at>
---------
Signed-off-by: Sunik Kupfer <kupfer@bitfire.at>
* Update authentication domain parameter
- Rename `onlyHost` to `authDomain` in `fromAccount`
- Update `authenticate` method to use `domain` instead of `host`
- Clarify documentation for `authDomain` parameter
* More KDoc
* Fix other calls / tests
* Move companion object to end of class
* Update synctools
* Make DmfsTaskList final
* Use DmfsTaskList SyncState
* Drop fields now provided in DmfsTask and adapt constructors
* Use column constants from DmfsTask instead
* Use DmfsTask column constants
* Update synctools
* Don't handle scheduleTag
Signed-off-by: Sunik Kupfer <kupfer@bitfire.at>
* Update synctools
Signed-off-by: Sunik Kupfer <kupfer@bitfire.at>
---------
Signed-off-by: Sunik Kupfer <kupfer@bitfire.at>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* Add ResourceDownloader and tests
- Introduce `ResourceDownloader` class for downloading external resources
- Add unit tests for `ResourceDownloader`
- Refactor `ContactsSyncManager` to use `ResourceDownloader`
* KDoc
- Add detailed documentation for `download` method
- Clarify authentication handling and return behavior
* Minor changes
Log warning instead of throwing IllegalStateException on multiple build calls
- Change `build()` to log a warning instead of throwing an exception on subsequent calls.
- Change `buildKtor()` to log a warning instead of throwing an exception on subsequent calls.
* Update WebDAV property names according to new dav4jvm naming scheme
* Use new supported-report-set; fix `MaxResourceSize` property reference in CalendarSyncManager
* Remove comment
- Update SyncManager to handle LocalStorageException with DeadObjectException cause
- Refactor Syncer to catch all exceptions and handle specific cases
Add @MustBeClosed annotation to buildKtor method
This commit adds the `@MustBeClosed` annotation to the `buildKtor` method in `HttpClientBuilder.kt` to indicate that the returned `HttpClient` instance must be closed by the caller. It also updates the test in `HttpClientBuilderTest.kt` to use the `use` function to ensure proper resource management.
* Increase logging level
* Adjust log levels for visibility in non-verbose logs
- Change log level from FINER to FINE in StreamingFileDescriptor
- Update log level from FINER to FINE in AccountSettingsMigration8
- Add note about log levels in LogManager documentation
* Fix KDoc typo
* Update comment
* Support viewing jtxBoard resources from debug info
* Correct value of EXTRA_LOCAL_RESOURCE_URI
* Correct comment
* Use the same intent for journals, notes, calendar and tasks
* State working task authorities explicitly
* Use edit action to not crash opentasks
* Use getViewIntentUriFor for jtx Board tasks
* Remove explicit tasks authority for jtx Board
* Remove explicit tasks authority for jtx Board
* Remove early return statement
* Dont handle jtxBoard tasks in LocalTask which is only for Dmfs tasks
* Add some kdoc to LocalTask and LocalJtxICalObject
* Use when with in list
* Add FLAG_GRANT_READ_URI_PERMISSION to the correct intent
* Correct line endings to from CRLF to LF
* Refactor ClientCertKeyManager and HttpClientBuilder
- Add logging to `ClientCertKeyManager` for better error handling.
- Update `HttpClientBuilder` to conditionally use custom trust manager and hostname verifier based on `allowCustomCerts` flag.
- Rename `customCertsUI` to `allowCustomCerts` in build configuration.
* Update trust manager and hostname verifier selection logic
- Improve logging and error handling in `ClientCertKeyManager`
* App settings: hide certificate settings when custom certificates are not allowed
* Typo
* Add AccountSettingsMigration21 to cancel pending address book syncs
* Add application context annotation
* Add log statement
* Increase account settings current version
* Add and update kdoc
* Call cancelSync via integration
* Optimize imports
* Update kdoc
* Updating log statement
* Also cancel calendar syncs
* Don't infer authority from account type
* Update kdoc
* Cancel only on Android 14+
* Cancel for all authorities and update kdoc
* Use cancelSync directly in migration
* Enable forever pending sync workaround by canceling sync adapter framework syncs on Android 14+
* Stop always returning false for pending sync state of sync adapter framework
* Cancel by request and empty bundle
* Cancel syncs for calendar, tasks, and contacts separately
* Minor edits to log statement and kdoc
* Add migration test; Update migration
* Log all extras instead of just upload flag
* Use lazy on syncFrameworkIntegration injection
* Multiple changes
- don't cancel address book accounts of all main accounts
- merge loops
* Add authority to log statement
* Replace complex state verification logic by status changed flow
* Cancel syncs account wide across all authorities
* Add some delay to allow dummy sync requests to be created
* Reduce wait until pending
* Drop Thread.sleep()
* Use a callback flow instead of mutable state flow
* Shorten first true filter
* Shorten remaining first true filter
* Merge HttpClient and HttpClientBuilder
- Remove `HttpClient` class and replace with `OkHttpClient`
- Update all references to `HttpClient` to use `OkHttpClient`
- Add new `HttpClientBuilder` class for building `OkHttpClient` instances
- Update all builder usages to use the new `HttpClientBuilder` class
* KDoc
* Integrate Conscrypt for TLS
- Add Conscrypt dependency
- Initialize Conscrypt in HttpClientBuilder
- Create ConscryptIntegration utility
* KDoc
* Make object a class, better test
* Update cert4android to the latest version (doesn't bundle Conscrypt anymore)
* Merge HttpClient and HttpClientBuilder
- Remove `HttpClient` class and replace with `OkHttpClient`
- Update all references to `HttpClient` to use `OkHttpClient`
- Add new `HttpClientBuilder` class for building `OkHttpClient` instances
- Update all builder usages to use the new `HttpClientBuilder` class
* KDoc
* Fix typo
* Also set OWNER_ACCOUNT when updating calendar because renaming account
* Add test
* Update comment clarifying content values
* Assume calendar provider is present and drop null checks
* Remove unnecessary AutoCloseable implementations and client.close() calls
- Remove AutoCloseable from NextcloudLoginFlow and DavResourceFinder
- Remove client.close() calls in various classes and tests
- Update HttpClient to remove close() method
* Fix test
* Fix annotations / KDoc
* Refactor sequence handling in calendar sync
- Move sequence update logic to SequenceUpdater
- Update LocalCalendar to use new SequenceUpdater
- Remove redundant methods from LocalCalendar
- Update tests and dependencies
* Minor KDoc
* [WIP] Proof of concept for syncing without `Event` data class
* Replace AndroidEvent2 with EventsContract
* Update synctools, refactor upload logic in `CalendarSyncManager`
* KDoc
* Update UID immediately in `ContactsSyncManager`, `CalendarSyncManager`, and `TasksSyncManager`
- Remove `OnSuccessContext.uid` from `GeneratedResource`
* Minor changes
* Handle multiple events in a single iCalendar
- Rename `processVEvent` to `processICalendar`
- Add default alarm for non-full-day events again
- Prevent NPE on null flags (used for debug info)
* Fix tests
* Define interfaces
* [WIP] Refactor sequence and UID handling in event uploads
- Refactor `generateUpload` method to return `GeneratedResource`.
- Update `SyncManager` to handle `GeneratedResource`.
- Implement sequence and UID management in `CalendarSyncManager`.
- Remove redundant `prepareForUpload` method from `LocalEvent`.
* Refactor sequence handling in uploads
- Move UID validation to `DavUtils.isGoodFileBaseName`
- Update sequence directly in iCalendar for group-scheduled events
- Rename `resourceBaseName` to `suggestedBaseName` for clarity
* Refactor sequence / UID handling in contact uploads
- Update `LocalAddress` interface to include `updateUid` method
- Modify `ContactsSyncManager` to handle UID generation and update
- Remove redundant UID handling in `LocalContact` and `LocalGroup`
- Adjust code style settings for right margin
* Remove redundant UID update from `ContactsSyncManager` and `CalendarSyncManager`
* Implement UID handling in `TasksSyncManager` for uploads
* Update JtxSyncManager
- Update `JtxSyncManager.kt` to implement the `generateUpload` function.
- Update `LocalJtxICalObject.kt` to include the `updateUid` method for updating UIDs in the collection.
* Remove deprecated `prepareForUpload` method from `LocalResource`
- Remove `prepareForUpload` implementations from `LocalContact`, `LocalEvent`, `LocalGroup`, and `LocalTask`
* Rename `isGoodFileBaseName` to `isGoodFileName` in `DavUtils`
* Fix tests
* Move UID generation logic to `DavUtils.generateUidIfNecessary`
- Use `DavUtils.fileNameFromUid` for generating file names
- Update `ContactsSyncManager`, `CalendarSyncManager`, `TasksSyncManager`, and `JtxSyncManager` to use new utility methods
* Add tests for DavUtils
* Some tests
* Refactor onSuccessfulUpload
* Update KDoc
* Logging
* Remove unnecessary LocalEvent method
* KDoc