Skip to content

Duplicated Import with Caldav calendarsΒ #978

@asdpatro-droid

Description

@asdpatro-droid

Checklist

  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected app version

1.9.0

Affected Android/Custom ROM version

Android 13

Affected device model

How did you install the app?

GitHub releases

Which calendar service or provider do you use, if any?

Nextcloud

Which sync adapter app do you use for calendar synchronization, if any?

DAVx5 / Nextcloud

Steps to reproduce the bug

  • Import ICS calendar into Caldav/Nextcloud synced calendar
  • Reimport an updated ICS (to update the existing events) into the Caldav/Nextcloud calendar

Expected behavior

  • Updates existing events or does nothing

Actual behavior

  • Duplicated events appear in the calendar

Screenshots/Screen recordings

No response

Additional information

app/src/main/kotlin/org/fossify/calendar/helpers/CalDAVHelper.kt seems to be related. UID/IDs from the ICS get replaced by one generated by this code:

private fun getCalDAVEventImportId(calendarId: Int, eventId: Long): String {
        return "$CALDAV-$calendarId-$eventId"
    }

As a result the code to detect duplicated events doesnt trigger as each gets a new unique eventId. Not sure where this limitation comes from.

When I import the ICS on nextcloud, it seems to keep the UID from ICS on nextcloud, but shows a "Caldav-00-000" formated UID on the mobile app.

If the calendar is local (not Caldav) the behaviour is as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not workingneeds triageIssue is not yet ready for PR authors to take up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions