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

Use ID to match DB collections with content provider collections #1274

Conversation

sunkup
Copy link
Member

@sunkup sunkup commented Jan 28, 2025

Purpose

We are currently still using the URL which is error prone. It might change and break the link.

Short description

  • Update ical4android
  • Syncer: Use ID to match DB collections with content provider collections
  • LocalCollections: Save the database collection ID in content provider collections instead of the resource URL
  • LocalCollectionsStores: Adapt accordingly
  • Adapt tests

See also https://github.com/bitfireAT/davx5/issues/603#issuecomment-2314844880

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@sunkup sunkup added the refactoring Internal improvement of existing functions label Jan 28, 2025
@sunkup sunkup self-assigned this Jan 28, 2025
@sunkup sunkup force-pushed the 603-syncer-only-use-id-to-match-local-db-collections-with-content-provider-collections branch from 3b5f685 to 552d1a2 Compare January 28, 2025 14:30
@sunkup sunkup requested a review from rfc2822 January 28, 2025 14:59
@sunkup sunkup marked this pull request as ready for review January 28, 2025 14:59
@sunkup
Copy link
Member Author

sunkup commented Jan 29, 2025

@rfc2822 Test testMigrate_AddressBook_InvalidCollection fails only in CI again. I would guess it's also due to #1273 but I am not sure.

@sunkup sunkup requested a review from rfc2822 January 29, 2025 09:50
@rfc2822
Copy link
Member

rfc2822 commented Jan 29, 2025

@rfc2822 Test testMigrate_AddressBook_InvalidCollection fails only in CI again. I would guess it's also due to #1273 but I am not sure.

Hm the error message looks different at least

 at.bitfire.davdroid.settings.migration.AccountSettingsMigration18Test > testMigrate_AddressBook_InvalidCollection[virtual] FAILED 
	java.lang.AssertionError: Verification failed: call 1 of 1: AccountManager(object AccountManager).setUserData(eq(Account {name=Address Book, type=at.bitfire.davdroid.address_book}), any(), any())) should not be called

@sunkup
Copy link
Member Author

sunkup commented Jan 29, 2025

Yes, and it happened after I removed the exception throw.

@rfc2822
Copy link
Member

rfc2822 commented Jan 29, 2025

Yes, and it happened after I removed the exception throw.

Guess it's then more related to that. Maybe the migration test has to be adapted

@sunkup
Copy link
Member Author

sunkup commented Jan 29, 2025

Yes, most likely. After reverting the commit the tests succeed again. This is weird though. It should not have any effect on the test 🤔

@sunkup sunkup force-pushed the 603-syncer-only-use-id-to-match-local-db-collections-with-content-provider-collections branch from 479991a to bb06506 Compare January 29, 2025 12:16
@sunkup
Copy link
Member Author

sunkup commented Jan 29, 2025

Now it succeeded. No changes whatsoever 👍

- remove unused param
- make companion methods internal
Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :)

@rfc2822 rfc2822 merged commit b910ba2 into main-ose Jan 29, 2025
8 checks passed
@rfc2822 rfc2822 deleted the 603-syncer-only-use-id-to-match-local-db-collections-with-content-provider-collections branch January 29, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants