Menu

#642 UID conflicts in example ICS

open
nobody
None
5
2012-12-21
2009-02-10
Jason Oster
No

This is just from the "US Holidays.ics":

WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: 2E934D31-A9BF-411E-AA55-9B7A9B98BA6F
WARNING: Global UID conflict: 92993955-69DD-44D8-B9BA-C5B8698D7FDC
WARNING: Global UID conflict: 267A335F-AF65-4868-A172-FC0E669B9767
WARNING: Global UID conflict: A5D84487-5E84-4E9C-BAAE-A9D64AECF74A
WARNING: Global UID conflict: CDBBF35A-582E-42BB-8DC3-9D0426BB6AA5
WARNING: Global UID conflict: E7C1CCB7-2060-45FB-83C4-012252D11B98
WARNING: Global UID conflict: 676F9DB9-2B83-497C-82E0-49989EB174B2
WARNING: Global UID conflict: D53ABCFC-5BA7-4500-81BD-93FCDD264DF4
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: 2E934D31-A9BF-411E-AA55-9B7A9B98BA6F
WARNING: Global UID conflict: 92993955-69DD-44D8-B9BA-C5B8698D7FDC
WARNING: Global UID conflict: 267A335F-AF65-4868-A172-FC0E669B9767
WARNING: Global UID conflict: A5D84487-5E84-4E9C-BAAE-A9D64AECF74A
WARNING: Global UID conflict: CDBBF35A-582E-42BB-8DC3-9D0426BB6AA5
WARNING: Global UID conflict: E7C1CCB7-2060-45FB-83C4-012252D11B98
WARNING: Global UID conflict: 676F9DB9-2B83-497C-82E0-49989EB174B2
WARNING: Global UID conflict: D53ABCFC-5BA7-4500-81BD-93FCDD264DF4
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008
WARNING: Global UID conflict: DF047E5D-E1BA-4DE8-82AC-FC61D621A008

I hacked a simple UID check into ical_parser.php:

case 'UID':
$uid = $data;
if (isset($validate_uid[$uid])) {
echo "WARNING: Global UID conflict: $uid<br/>\n";
}
$validate_uid[$uid] = 1;
break;

According the IETF2445 iCalendar specification:

4.8.4.7 Unique Identifier
... The UID itself MUST be a globally unique identifier. The generator of the identifier MUST guarantee that the identifier is unique.

This bug manifests itself by "hiding" events with duplicate UIDs from the "This Month's Events" at the bottom of the Month View (see US Holidays Feb. 2009; "Ash Wednesday" is not displayed). It also makes it extremely difficult to choose the correct event for editing, among other things.

A simple work-around is to make ical_parser.php append an incrementing number to the UID:

case 'UID':
$uid = $data . '-' . $rolling_uid;
$rolling_uid++;
break;

But I don't know what all this might break.

Unfortunately, I think this problem (generally not handling duplicate UID; though they should not exist) is blocking my work on adding event editing to phpiCalender 2.x.

Discussion

  • Jim Hu

    Jim Hu - 2009-02-11

    I believe that UID can be the same if sequence is different. The sample calendars I made for testing are probably horrible wrt UID; I hand edited a lot of those.

     
  • Jim Hu

    Jim Hu - 2009-02-11

    Oops, just read it more carefully. The US Holidays calendar was also made by me by editing in a text editor. I think the thing to do on that one is to rebuild the file and make new UIDs.

     

Log in to post a comment.