fix: correct time range validation error message#5330
fix: correct time range validation error message#5330judehung merged 1 commit intoedgexfoundry:mainfrom
Conversation
Signed-off-by: remo-lab <remo@DESKTOP-V3SPST8.localdomain>
262b449 to
1d43402
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5330 +/- ##
=======================================
Coverage 21.17% 21.17%
=======================================
Files 285 285
Lines 20958 20958
=======================================
Hits 4438 4438
Misses 16167 16167
Partials 353 353 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @judehung , just wanted to gently check in on this when you have some time. |
judehung
left a comment
There was a problem hiding this comment.
Thanks for catching this—the fix looks good to me.
|
Thanks @judehung for the review and merge. I’m planning to continue contributing here and was curious about future LFX mentorship cycles. Is there a usual place where EdgeX / LF Edge announcements are shared? |
|
@remo-lab you can join the TSC meeting or technical working group meeting to discuss the scope and how you want to contribute to the community Subscribe the calendar to see the meeting date/time However, it's Christmas season and year end, so there is no meeting until next year. |



Need for Change:
-This PR fixes a misleading error message in time range validation logic.
-The validation correctly checks for end < start, but the error message previously stated that end was not allowed to be greater than start, which is contradictory and confusing for API consumers.
What was changed:
File: internal/pkg/utils/http.go
Functions affected:
-ParseTimeRangeOffsetLimit (around line 171)
-ParseQueryStringTimeRangeOffsetLimit (around line 191)
Change:
Updated the error message from:
"end's value %v is not allowed to be greater than start's value %v"
To:
"end's value %v is not allowed to be less than start's value %v"
Impact:
-Affects 13+ call sites across multiple services:
Core Data
Support Notifications
Support Scheduler
-User-facing improvement: API consumers now receive a clear and correct error message
-No behavior or contract changes — message-only fix
screenshot of code before the fix:
BREAKING CHANGE:describing the break)Testing Instructions:
-Call any API endpoint using time range parameters where end < start
-Verify the error message now correctly states that end must not be less than start