Skip to content

fix: use ISO-8601 format for share expiration dates#16

Open
zerox80 wants to merge 2 commits into
mainfrom
fix/expiration-date-format
Open

fix: use ISO-8601 format for share expiration dates#16
zerox80 wants to merge 2 commits into
mainfrom
fix/expiration-date-format

Conversation

@zerox80
Copy link
Copy Markdown
Owner

@zerox80 zerox80 commented May 19, 2026

Description

This change updates the formatting of the share expiration date (expireDate) sent by the Android app when creating or updating shares. Currently, the app formats the date as "yyyy-MM-dd".

While the public link sharing endpoint in the backend has a fallback that parses this date-only format, the endpoints for private shares (user/group shares) and space membership do not.
Specifically:

  • createUserShare (in user.go) expects _iso8601 = "2006-01-02T15:04:05Z0700".
  • updateShare (in shares.go) expects time.RFC3339 ("2006-01-02T15:04:05Z07:00").
  • addSpaceMember (in spaces.go) expects either layout.

Because "yyyy-MM-dd" doesn't match either pattern, creating or updating a private share or space membership with an expiration date always fails with an HTTP 400 Bad Request ("could not parse expireDate").

To resolve this without needing backend changes, this PR updates both CreateRemoteShareOperation and UpdateRemoteShareOperation to format the expiration timestamp as a standard UTC ISO-8601 string ("yyyy-MM-dd'T'HH:mm:ss'Z'"), which parses successfully across all backend endpoints.

Note

Although the Android app's user interface (EditPrivateShareFragment) does not currently expose setting expiration dates for private shares, the core SDK library classes (CreateRemoteShareOperation and UpdateRemoteShareOperation) are designed to handle them. This patch is necessary to ensure that when the private share expiration feature is implemented in the mobile UI, these SDK operations do not trigger 400 Bad Request errors on the backend.

Changes

  • Changed FORMAT_EXPIRATION_DATE pattern to "yyyy-MM-dd'T'HH:mm:ss'Z'" in CreateRemoteShareOperation.kt and UpdateRemoteShareOperation.kt.
  • Configured SimpleDateFormat to use the UTC timezone.

@zerox80 zerox80 force-pushed the fix/expiration-date-format branch from c6bbbda to 929d7ce Compare May 20, 2026 06:23
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.

1 participant