Skip to content

Handle invalid visits API time ranges - #3211

Open
Freika wants to merge 1 commit into
devfrom
fix/visits-invalid-time-range
Open

Handle invalid visits API time ranges#3211
Freika wants to merge 1 commit into
devfrom
fix/visits-invalid-time-range

Conversation

@Freika

@Freika Freika commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • convert malformed time-range parser failures into a visits-specific input error
  • return HTTP 400 instead of reporting an application exception
  • preserve the existing bounding-box fallback behavior

Verification

  • asdf exec bundle exec rspec spec/requests/api/v1/visits_spec.rb spec/services/visits/find_in_time_spec.rb spec/services/visits/find_within_bounding_box_spec.rb — 47 examples, 0 failures
  • asdf exec bundle exec rubocop app/controllers/api/v1/visits_controller.rb app/services/visits/find_in_time.rb app/services/visits/invalid_time_range.rb spec/requests/api/v1/visits_spec.rb — no offenses

- Handle invalid visits API time ranges
- Reject malformed dates on the area-based visits path
- Move Visits::InvalidTimeRange to app/errors and base it on StandardError
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f3b09e5-5c98-4315-8426-b957a65b7853

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/visits-invalid-time-range

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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