Make Member.ExpiresAt tolerant of unparseable expiry dates#48
Merged
Merged
Conversation
GitLab returns a project member's expires_at as a user-entered date that can be malformed (e.g. Fiserv's "20235-12-04", a 5-digit year beyond DateTime's max). Deserializing it into a non-nullable DateTime threw "Could not convert string to DateTime" and failed the whole member list, so the repository's access never synced. Add TolerantNullableDateTimeConverter, which yields null for unparseable/empty values, and make Member.ExpiresAt a nullable DateTime? using it. The rest of the member list now deserializes even when one member has a bad expiry date. expires_at is also genuinely optional in GitLab, so DateTime? is the correct type. Bump package version to 0.1.46 (0.1.45 was published then reverted). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
snirburkush
approved these changes
Jul 20, 2026
dylan-apiiro
marked this pull request as ready for review
July 20, 2026 12:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GitLab returns a project member's
expires_atas a user-entered date that can be malformed. A customer (gitlab.somedomain.net) has a member withexpires_at = "20235-12-04"— a 5-digit year beyondDateTime's max (9999).Member.ExpiresAtwas a non-nullableDateTime, so Newtonsoft threwJsonReaderException: Could not convert string to DateTimewhile deserializing, which failed the entire member list. Inlim, that means the repository's access sync silently produces stale data for the affected customer.Fix
TolerantNullableDateTimeConverter(Internal/Http/Serialization/) — yieldsnullfor unparseable or empty date strings instead of throwing; parses valid dates normally.Member.ExpiresAta nullableDateTime?decorated with the converter.expires_atis genuinely optional in the GitLab API (members without an expiry returnnull), soDateTime?is also the correct type — the old non-nullableDateTimemapped anull/missing expiry to0001-01-01.Tests
MemberExpiresAtTestcovers: unparseable date →nullwhile the rest of the list still deserializes; explicitnull; missing; and a valid date parsed correctly. All pass (Release build clean).Release
Bumps
<Version>to 0.1.46 (0.1.45 was published then reverted). After merge, publish0.1.46to GitHub Packages (nuget.pkg.github.com/apiiro) solimcan bump its pin — the CIrelease: publishedstep targets nuget.org and does not feed the GitHub Packages feedlimrestores from.Part of LIM-42613