Missions Control fixes + Add Manual Throttle Launch Option - #2704
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoMission Control waypoint fixes and manual throttle launch option
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
|
Code Review by Qodo
1. NaN written to waypoint
|
| if (selectedMarker.getAction() != MWNP.WPTYPE.SET_HEAD) { | ||
| $('#pointP1').val(Math.abs(Number($('#pointP1').val()))); | ||
| } |
There was a problem hiding this comment.
1. Nan written to waypoint 🐞 Bug ≡ Correctness
The new Math.abs(Number(...)) normalization for #pointP1/#pointP2 writes "NaN" back into the input when the value isn’t numeric, and then persists NaN into Waypoint P1/P2. When missions are serialized, NaN is coerced to 0 via bitwise byte extraction, silently changing the transmitted/saved parameter values.
Agent Prompt
### Issue description
`#pointP1` and `#pointP2` are text inputs; the new normalization uses `Math.abs(Number(value))` and writes the result back to the input. For any non-numeric value, `Number(value)` becomes `NaN`, `Math.abs(NaN)` remains `NaN`, and jQuery `.val(NaN)` displays `"NaN"`, which then gets stored in the `Waypoint` via `setP1/setP2`.
Downstream, waypoint parameters are serialized with bitwise operations (`BitHelper.lowByte/highByte`), which coerce `NaN` to `0`, so missions can be silently altered when sent/saved.
### Issue Context
This is a regression in behavior/UX introduced by the new “force positive” logic: previously invalid text could still be entered (and would become `NaN` in the model), but it would not be rewritten into the visible field as the literal string `"NaN"`.
### Fix Focus Areas
- tabs/mission_control.js[3138-3159]
### Suggested fix approach
- Parse once into a local `const v = Number($('#pointP1').val())` (and similarly for P2).
- Guard with `Number.isFinite(v)` (or at least `!isNaN(v)`), and if invalid:
- revert the input to the previous valid value (e.g., `selectedMarker.getP1()` / `getP2()`), and **do not** update the waypoint, or
- clamp to a safe default (e.g., `0`) and optionally show a validation warning.
- Only apply `Math.abs(v)` after the finite-number check.
- Optionally, consider converting the HTML inputs to `type="number"` with `min="0"` for actions where negatives are invalid (but keep SET_HEAD and JUMP repeat semantics intact).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Configurator test build ready — commit Download build artifacts for PR #2704 Available platforms (scroll to the Artifacts section at the bottom of the run page):
|



Adds missing speed option for landing waypoints and restricts waypoint P1 and P2 to only +ve values where applicable.