Skip to content

BugFix - CalendarImportWork #14757

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Apr 4, 2025

  • Tests written, or not not needed

Changes

Previously, if any calendar source import job failed, it caused the entire calendar event import to fail.

The visibility logic for the date picker, which was previously tied only to contactsBackupFolder, has been extended to also consider calendarBackupFolderPath.

Duplicated code has been extracted into a new getBackupFiles() method.

The legacy AsyncTask implementation has been replaced with Kotlin Coroutines.

Copy link

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 24.24%. Comparing base (0cdbc00) to head (a631445).

Files with missing lines Patch % Lines
...va/com/nextcloud/client/jobs/CalendarImportWork.kt 0.00% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14757      +/-   ##
============================================
+ Coverage     24.23%   24.24%   +0.01%     
- Complexity     3333     3334       +1     
============================================
  Files           700      700              
  Lines         51340    51350      +10     
  Branches       6928     6931       +3     
============================================
+ Hits          12443    12451       +8     
  Misses        36955    36955              
- Partials       1942     1944       +2     
Files with missing lines Coverage Δ
...va/com/nextcloud/client/jobs/CalendarImportWork.kt 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alperozturk96 alperozturk96 force-pushed the bugfix/calendar-import-work branch from dfef7bf to f2dfc6a Compare April 11, 2025 08:20
@alperozturk96 alperozturk96 changed the title BugFix - CalendarImportWork ClassCastException BugFix - CalendarImportWork Apr 11, 2025
@@ -239,61 +249,67 @@ class BackupFragment : FileFragment(), OnDateSetListener, Injectable {
openDate(selectedDate)
}

val contactsPreferenceActivity = activity as ContactsPreferenceActivity?
if (contactsPreferenceActivity != null) {
val backupFolderPath = resources.getString(R.string.contacts_backup_folder) + OCFile.PATH_SEPARATOR
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tobiasKaminsky

Why is only contactsBackupFolder being used in this case? We also have a calendarBackupFolder, so shouldn't we be checking for the existence of both?

Additionally, how is it that refreshing the contents of the contactsBackupFolder results in calendar backups appearing as well? With the new implementation, I can now see both calendars and contacts, but I’d like to understand the reasoning behind this behavior.

Copy link
Member

Choose a reason for hiding this comment

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

Why is only contactsBackupFolder being used in this case? We also have a calendarBackupFolder, so shouldn't we be checking for the existence of both?

Indeed, we should.

Additionally, how is it that refreshing the contents of the contactsBackupFolder results in calendar backups appearing as well? With the new implementation, I can now see both calendars and contacts, but I’d like to understand the reasoning behind this behavior.

Both folders are updated within onDateSet and openDate.

@tobiasKaminsky
Copy link
Member

Test also on master to check if the import works

@alperozturk96 alperozturk96 added the ux-enhancement Improvements that refine user interactions, accessibility, or overall usability label May 3, 2025
@alperozturk96 alperozturk96 force-pushed the bugfix/calendar-import-work branch from b541498 to 56326c6 Compare June 2, 2025 10:44
@alperozturk96 alperozturk96 force-pushed the bugfix/calendar-import-work branch from 56326c6 to f7ca5cf Compare July 16, 2025 10:59
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
…restore backup button. Because if backup exists restore backup button will be visible without backupNow button and UI going to look weird

Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
@alperozturk96 alperozturk96 force-pushed the bugfix/calendar-import-work branch from f7ca5cf to 7bdcc9c Compare July 23, 2025 15:04
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14757.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review ux-enhancement Improvements that refine user interactions, accessibility, or overall usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants