Skip to content

Use nc:creation_time instead of d:creationdate#44

Open
Copilot wants to merge 3 commits intomainfrom
copilot/update-server-response-parsing
Open

Use nc:creation_time instead of d:creationdate#44
Copilot wants to merge 3 commits intomainfrom
copilot/update-server-response-parsing

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

d:creationdate returns an ISO8601 string (1970-01-01T00:00:00+00:00) requiring expensive date parsing. nc:creation_time returns a Unix timestamp (0), which is simpler and more robust to parse.

  • Request body (Listing.xml): Request <nc:creation_time /> instead of <d:creationdate />
  • Response parser (ResponseParser.swift): Parse Unix timestamp via Date(timeIntervalSince1970:) instead of ISO8601DateFormatter
  • Test fixtures: Updated all 26 Body.xml fixtures to use <nc:creation_time>0</nc:creation_time>
// Before
guard let creationString = prop.firstElement(forName: "d:creationdate")?.stringValue,
      let creationDate = ISO8601DateFormatter().date(from: creationString) else { ... }

// After
guard let creationString = prop.firstElement(forName: "nc:creation_time")?.stringValue,
      let creationTimeInterval = TimeInterval(creationString) else { ... }
let creationDate = Date(timeIntervalSince1970: creationTimeInterval)
Original prompt

This section details on the original issue you should resolve

<issue_title>Use nc:creation_time instead of d:creationdate</issue_title>
<issue_description>## Problem

A PROPFIND to a resource with the <d:creationdate /> returns this specific information:

<d:creationdate>1970-01-01T00:00:00+00:00</d:creationdate>

This is more expensive and fragile to parse.

Goal

Request <nc:creation_time /> instead of <d:creationdate /> which returns this:

<nc:creation_time>0</nc:creation_time>

The value is equal to <d:creationdate>1970-01-01T00:00:00+00:00</d:creationdate>.

Tasks

  • Update the server response parsing code
  • Update the test fixtures
  • Update the test code

References

https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#supported-properties</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 2, 2026 13:25
- Update PROPFIND request body to request nc:creation_time
- Update ResponseParser to parse Unix timestamp instead of ISO8601 date
- Update all test fixture XML files to use nc:creation_time

Co-authored-by: i2h3 <142165879+i2h3@users.noreply.github.com>
Co-authored-by: i2h3 <142165879+i2h3@users.noreply.github.com>
Copilot AI changed the title [WIP] Use nc:creation_time instead of d:creationdate Use nc:creation_time instead of d:creationdate Mar 2, 2026
Copilot finished work on behalf of i2h3 March 2, 2026 13:27
@i2h3 i2h3 marked this pull request as ready for review March 2, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use nc:creation_time instead of d:creationdate

2 participants