Repository navigation
Conversation
Beacon's tasking endpoints have been known to return 500 after applying the change. The Ops/Radio Log dialog reported those as failures, so the log wasn't saved and a retry re-sent the change. On a 5xx or network error the dialog now reloads that incident's taskings and checks whether the change landed (the tasking has the requested status, or the team now has an active tasking there). If it did, the submit carries on and saves the log; if not, the error is shown as before. A 4xx still fails straight away. The banner for a failed status change or tasking is now just Beacon's message plus "Try again"; the full error (status, URL, body) goes to the console. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Beacon's tasking endpoints have been known to return 500 after applying the change. The Ops/Radio Log dialog reported those as failures, so the log wasn't saved and a retry re-sent the change. On a 5xx or network error the dialog now reloads that incident's taskings and checks whether the change landed (the tasking has the requested status, or the team now has an active tasking there). If it did, the submit carries on and saves the log; if not, the error is shown as before. A 4xx still fails straight away. The banner for a failed status change or tasking is now just Beacon's message plus "Try again"; the full error (status, URL, body) goes to the console. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mbers/Lighthouse into rmacdonald-radiolog-wip
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fields aren't locked while submitting, so reading activeTasking() could look at a different team if the Team field was edited during the reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
The Ops/Radio Log dialog changes a team's status or tasks a team before saving the log, and only saves the log if that worked. It asks BeaconClient to throw on errors (
throwOnError) so it knows whether the change landed.The comment at the top of
src/shared/BeaconClient/tasking.jssays those endpoints "intermittently return 500 despite applying the change". We don't know if Beacon still does this. If it does, the dialog reports a change that worked as a failure and doesn't save the log. A retry then sends the change again, and Beacon rejects it with an error.This PR makes the dialog check before it reports a failure.
What changes
On a 5xx or network error, the dialog reloads that incident's taskings and checks whether the change went through:
If it went through, the submit carries on as if it had succeeded: the log is saved, the dialog closes, and for Task Team & SMS the Send SMS dialog opens. A
console.warnrecords that Beacon returned an error but the change landed.If it didn't go through, or the reload also fails, the error is shown as before. A retry is then checked against freshly loaded data.
A 4xx still fails straight away. Our own errors (such as Beacon not returning a new tasking) and aborted requests also fail straight away.
Simpler error banner. A failed status change or tasking now shows
Error: <Beacon's message>. Try again.. If Beacon gave no message, it shows the status code (Beacon returned 500 Internal Server Error) orCouldn't reach Beacon. The full error goes to the console: what was attempted, plus the status, URL, response body and error object.These messages are unchanged:
Implementation
OpsLogModalVM.jsapplyAndConfirm(job, apply, landed)wraps bothapplyTaskingStatusChangeandapplyTaskTeam.isUncertainFailure(err)decides which errors trigger the check: 5xx or network errors. 4xx, errors with auserMessage, andAbortErrordon't.submitFailureMessageandlogSubmitFailure.main.jsreloadJobTaskings(jobVm)reloads one incident: oneGET /Api/v1/Tasking/Search?JobIds[]=<id>through the existingfetchJobTasking.trueorfalse.Taskingobjects are updated in place byupsertTaskingFromPayload.BeaconClientis unchanged. Other callers still usenullOnError.Known limitation
LAD doesn't remove taskings that are missing from a reload. If Beacon leaves untasked taskings out of
Tasking/Searchrather than returning them asUntasked, a false 500 on Untask still shows as an error. A retry should then just get a 4xx back from Beacon. Nothing is applied twice.Docs
docs/lad/logs-and-messages.md: the Submit behaviour for status changes and Task Team is now one short paragraph each: LAD does the status change or tasking first, then saves the log; if anything goes wrong the dialog shows the error so you can submit again; nothing is sent twice.Testing
npm test: all 688 tasking tests pass, including 6 new ones inOpsLogModalVM.test.js:npm run lint: clean.scripts/lad-docsharness: I mockedPOST /Api/v1/Taskingto create the tasking and then return 500. The dialog sent one POST, found the tasking on reload, saved the log and closed.🤖 Generated with Claude Code