Fixed issue where dismissing a notification returns a 500 error#337
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the “dismiss notification” workflow by aligning the frontend DELETE call with the backend endpoint contract (sending the notification key as a URL query parameter rather than a request body) and ensuring the frontend returns the real success/failure result.
Changes:
- Webapp: send
keyas a DELETE query parameter and return the computedsuccessvalue fromdismissNotifications. - Intersection API: change delete endpoint to accept
keyvia@RequestParam, add basic validation, and normalize the key before deletion. - Tests/controllers: formatting-only changes in
ActiveNotificationControllerTestandIntersectionController.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| webapp/src/apis/intersections/notification-api.ts | Updates dismiss call to pass key as a query param and return actual success/failure. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/controllers/intersections/ActiveNotificationController.java | Updates DELETE endpoint to read key from query params, validates/normalizes input. |
| services/intersection-api/api/src/test/java/us/dot/its/jpo/ode/api/controllers/intersections/ActiveNotificationControllerTest.java | Whitespace/formatting changes (plus opportunities for cleanup noted in comments). |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/controllers/intersections/IntersectionController.java | Whitespace/formatting changes; uncovered an issue with longitude/latitude default values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+218
to
+220
| ResponseStatusException thrown = assertThrows( | ||
| ResponseStatusException.class, | ||
| () -> controller.deleteActiveNotification(key)); |
Comment on lines
+112
to
+118
| if (!StringUtils.hasText(key)) { | ||
| return ResponseEntity.status(HttpStatus.BAD_REQUEST) | ||
| .body("Missing required notification key"); | ||
| } | ||
|
|
||
| String normalizedKey = key.replace("\"", "").trim(); | ||
| long count = activeNotificationRepo.delete(normalizedKey); |
drewjj
approved these changes
Jun 19, 2026
drewjj
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Just the one comment but nothing blocking.
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.
This PR fixes a problem where the notification deletion endpoint is improperly passed to the API endpoint as an improperly encoded request body, this results in a 500 error from the API. This issue can be replicated by trying to dismiss a notification from the intersection page of the CV-Manager GUI. This PR fixes the issue by passing the notification ID as a url parameter instead which simplifies the procedure. Additionally this PR adjusts the return value of the api call in the front end so that it returns whether the notification deletion succeeded or failed properly.
This PR also fixes a minor bug where the default arguments for the getIntersectionsByLocation function are booleans while the values they represent should be doubles. Since these parameters are actually required, the incorrect defaults were removed and the function arguments were marked as required.