Event scheduled on 4th monday of november appears every monday of november



  • Our big holiday is scheduled on the 4th monday of november. DAVx5 syncs it into every monday of november, though.

    • Android 10
    • DAVx5 2.6-gplay (308) 25.10.2019

    Using vdirsync, I get the event as follows; it seems that BYSETPOS is ignored by DAVx5:

    BEGIN:VCALENDAR
    PRODID:Zimbra-Calendar-Provider
    VERSION:2.0
    BEGIN:VEVENT
    UID:uuuuuuuuuuuuuuuuuuuuuuuuu
    RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=MO;BYMONTH=11;BYSETPOS=4
    SUMMARY:Zibelemärit
    DESCRIPTION:\n
    LOCATION:Bern
    ORGANIZER:mailto:a@b.ch
    DTSTART;VALUE=DATE:20181126
    DTEND;VALUE=DATE:20181127
    STATUS:CONFIRMED
    CLASS:PUBLIC
    X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
    TRANSP:TRANSPARENT
    LAST-MODIFIED:20181126T205959Z
    

    Thanks

    Thomas


  • developer

    Hello!

    Thanks for your report. I could reproduce it with Android 10 (emulated).

    Unfortunately, the Android calendar provider currently doesn’t support all BYDAY rules. When DAVx⁵ inserts the event, these are the logs:

    ical4android: [AndroidEvent] Built event object
    ical4android: 	PARAMETER #0 = mType: 1, mUri: content://com.android.calendar/events?caller_is_syncadapter=true&account_name=test&account_type=bitfire.at.davdroid&caller_is_syncadapter=true&account_name=test&account_type=bitfire.at.davdroid, mSelection: null, mExpectedCount: null, mYieldAllowed: false, mValues: organizer=a@b.ch duration=P1D description=
    ical4android:  allDay=1 accessLevel=3 hasAttendeeData=1 eventLocation=Bern eventStatus=1 rrule=FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYDAY=MO;BYSETPOS=4 title=Zibelemärit eventTimezone=Etc/UTC calendar_id=5 dtstart=1543190400000 availability=1, mValuesBackReferences: null, mSelectionArgsBackReferences: null
    ical4android: [BatchOperation] Committing 4 operations
    ical4android: [BatchOperation] Running 4 operations (0 .. 3)
    ical4android: [BatchOperation] … 3 record(s) affected
    11-09 18:05:12.108  3574  6218 V RecurrenceProcessor: BYSETPOS not supported with these rules: FREQ=YEARLY;INTERVAL=1;WKST=MO;BYDAY=MO;BYMONTH=11;BYSETPOS=4
    

    Note that DAVx⁵ inserts the event with the full rrule=FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYDAY=MO;BYSETPOS=4. However, Android’s RecurrenceProcessor says that BYSETPOS not supported with these rules.

    If you look up the RecurrenceProcessor source code, you can see that only FREQ=MONTHLY is supported.

    So, unfortunately, your recurring event is not supported by Android. The problem has already been reported to Google, but they classified it as Won’t Fix (Obsolete) without comment.

    Does that help?



  • Thanks!

    https://android.googlesource.com/platform/frameworks/opt/calendar/+/06b3293d5af3454a39681cfd659271551354b8a0/src/com/android/calendarcommon2/RecurrenceProcessor.java
    line#283ff confirms your findings:

                // BYSETPOS - we only handle rules like FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1
                if (freq == EventRecurrence.MONTHLY && r.bydayCount > 0) {
    // ...
                } else {
                                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                                    Log.v(TAG, "BYSETPOS not supported with these rules: " + r);
                                }
                            }
                // BYSETPOS was defined but we don't know how to handle it.  Do no filtering based
                // on it.
    

    Not sure how current this code is.

    So the bug report should go to Google/Android.


Log in to reply
 

Similar topics

  • 1
  • 7
  • 3