Skip to content

Comments

fix: correct time range validation error message#5330

Merged
judehung merged 1 commit intoedgexfoundry:mainfrom
remo-lab:fix/time-range-error-message
Dec 17, 2025
Merged

fix: correct time range validation error message#5330
judehung merged 1 commit intoedgexfoundry:mainfrom
remo-lab:fix/time-range-error-message

Conversation

@remo-lab
Copy link
Contributor

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:

Screenshot 2025-12-17 042929 Screenshot 2025-12-17 042846
  • [✔️ ] I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • [✔️ ] I am not introducing a new dependency (add notes below if you are)
  • [❌ ] I have added unit tests for the new feature or bug fix (if not, why?)
  • [✔️ ] I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

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

Signed-off-by: remo-lab <remo@DESKTOP-V3SPST8.localdomain>
@remo-lab remo-lab force-pushed the fix/time-range-error-message branch from 262b449 to 1d43402 Compare December 16, 2025 23:32
@sonarqubecloud
Copy link

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.17%. Comparing base (2d48adb) to head (1d43402).

Files with missing lines Patch % Lines
internal/pkg/utils/http.go 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@remo-lab
Copy link
Contributor Author

Hi @judehung , just wanted to gently check in on this when you have some time.
All checks are passing now. Please let me know if any changes are needed.
Thank you!

Copy link
Member

@judehung judehung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this—the fix looks good to me.

@judehung judehung merged commit dd9e956 into edgexfoundry:main Dec 17, 2025
7 checks passed
@remo-lab
Copy link
Contributor Author

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?

@cloudxxx8
Copy link
Member

@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
https://lf-edgexfoundry.atlassian.net/wiki/spaces/FA/pages/11667441/Technical+Steering+Committee+TSC
https://lf-edgexfoundry.atlassian.net/wiki/spaces/FA/pages/11678762/Technical+Working+Group

Subscribe the calendar to see the meeting date/time
https://lf-edgexfoundry.atlassian.net/wiki/spaces/FA/pages/11670598/Community+Meetings+Calendar

However, it's Christmas season and year end, so there is no meeting until next year.

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.

4 participants