Skip to content

fix(SDK-1266): guard against a partial date range reaching Apply - #2717

Open
krisxcrash wants to merge 1 commit into
mainfrom
kw/fix/sdk-1266-date-range-filter-partial-range
Open

fix(SDK-1266): guard against a partial date range reaching Apply#2717
krisxcrash wants to merge 1 commit into
mainfrom
kw/fix/sdk-1266-date-range-filter-partial-range

Conversation

@krisxcrash

Copy link
Copy Markdown
Contributor

Summary

  • DateRangeFilter.handleApply() treated draftRange as valid whenever the object was truthy, without checking that start and end were both present.
  • The SDK's own default calendar-based DateRangePicker can never emit a one-sided range (react-aria withholds onChange until both sides are complete), so this gap was invisible there — but DateRangeFilter accepts any DateRangePicker adapter, and a non-conforming one could emit a partial range that would sail through to getApiDateParams(), building an asymmetric request that surfaced as a generic, confusing error.
  • handleRangeChange now coerces any range missing either side to null, so Apply falls through to the existing clean-reset path instead.

Jira: SDK-1266

Test plan

  • DateRangeFilter.test.tsx passes (7/7)
  • eslint/tsc --noEmit clean
  • Manually reproduce the reported flow (open the date filter on Payroll History, Reset, set only an end date, Apply) and confirm a clean reset instead of an error

DateRangeFilter treated draftRange as appliable whenever the object was
truthy, without checking that both start and end were present. The default
DateRangePicker can never emit a one-sided range, but any other
DateRangePicker adapter (including a host's custom implementation) could,
and a one-sided range silently produced an asymmetric API request that
surfaced as a generic, confusing error. A malformed range now collapses to
"no selection" instead.
@krisxcrash
krisxcrash marked this pull request as ready for review September 4, 2026 23:36
@krisxcrash
krisxcrash requested a review from a team as a code owner September 4, 2026 23:36
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