Page MenuHomePhorge

Bifrost#T36198: Create non-conflicting ServerId for objects with non-unique or long UID
ClosedPublic

Authored by machniak on Jul 19 2017, 1:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 10, 10:00 PM
Unknown Object (File)
Feb 14 2024, 4:31 PM
Unknown Object (File)
Feb 14 2024, 1:29 PM
Unknown Object (File)
Jan 21 2024, 12:38 PM
Unknown Object (File)
Jan 20 2024, 4:41 AM
Unknown Object (File)
Jan 20 2024, 2:10 AM
Unknown Object (File)
Jan 20 2024, 1:59 AM
Unknown Object (File)
Jan 19 2024, 8:35 AM
Subscribers

Details

Summary

This fixes two cases:

  • Activesync client creating an object with very long UID (more than 64 chars)
  • Storage containing more than one copy of the same event.

Diff Detail

Repository
rS syncroton
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vanmeeuwen subscribed.

Please see the inline commentary / questions.

lib/kolab_sync_data.php
977

Would there be a reason to not let $folder->get_object($uid) fail before doing the more expensive preg_match()?

Could we clause with a strstr($uid, 'CRC') == 0 to clause the expensive preg_match() only happening against the sub-set of UIDs?

1913

this substr($uid, 0, 53) will actually constitute up to 54 characters, right? We only have 53 left.

This revision now requires changes to proceed.Jul 19 2017, 3:33 PM
machniak edited edge metadata.
machniak added inline comments.
lib/kolab_sync_data.php
977

As it is prefix match I don't think it would give as much more performance. Besides, after this change all UIDs are supposed to be CRC-prefixed. So, it is more a sanity check + string exploding.

1913

3rd argument of substr() is requested length.

vanmeeuwen added inline comments.
lib/kolab_sync_data.php
977

OK, agreed.

1913

Ah, I thought it was the end position, starting from 0 ;-)

This revision is now accepted and ready to land.Jul 19 2017, 3:41 PM
This revision was automatically updated to reflect the committed changes.