Skip to content

Issue retrieving ctag (why fuzzyUrlEquals?) #125

Description

@marcoancona

Why fuzzyUrlEquals(one, other) is implemented checking wheter one is included in other and the other way around?
Let's consider the request to get the ctag for a calendar collection. This an example of response I get:

<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:fx="http://fruux.com/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav">
  <d:response>
    <d:href>/calendars/a3298212081/</d:href>
    <d:propstat>
      <d:prop>
        <cs:getctag/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/calendars/a3298212081/c7972891-adfe-4ef8-a499-248411cace6e/</d:href>
    <d:propstat>
      <d:prop>
        <cs:getctag>http://sabre.io/ns/sync/15</cs:getctag>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/calendars/a3298212081/f27d33b1-d5bd-4695-9086-8c1607b9f85d/</d:href>
    <d:propstat>
      <d:prop>
        <cs:getctag>http://sabre.io/ns/sync/4</cs:getctag>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Now the logic of isCollectionDirty() (

let response = responses.filter(response => {
) will match the account, instead of matching the calendar because the account url is a substring of the calendar url. Therefore the ctag will always appear empty. Am I missing something?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions