Skip to content

Commit 0c4c310

Browse files
samfreundGold856
andauthored
Fix pipeline type when creating a new pipeline being off by one (#2229)
## Description <!-- What changed? Why? (the code + comments should speak for itself on the "how") --> <!-- Fun screenshots or a cool video or something are super helpful as well. If this touches platform-specific behavior, this is where test evidence should be collected. --> <!-- Any issues this pull request closes or pull requests this supersedes should be linked with `Closes #issuenumber`. --> This cherry-picks the bug fix from #2225, but not the tests as we're having issues with those. #2225 will remain open for the tests. #2204 fixed the off-by-one error on the frontend, but again, because enums are serialized with ordinal(), DataSocketHandler needed to be updated to account for the indices shifting by one. ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2 - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] ~If this PR addresses a bug, a regression test for it is added~ Deferred Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
1 parent 98f4a86 commit 0c4c310

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

photon-server/src/main/java/org/photonvision/server/DataSocketHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void onBinaryMessage(WsBinaryMessageContext context) {
155155
// var name = (String) data.get("pipelineName");
156156
var arr = (ArrayList<Object>) entryValue;
157157
var name = (String) arr.get(0);
158-
var type = PipelineType.values()[(Integer) arr.get(1) + 2];
158+
var type = PipelineType.values()[(Integer) arr.get(1) + 3];
159159

160160
dcService.publishEvent(
161161
new IncomingWebSocketEvent<>(

0 commit comments

Comments
 (0)