fix(www): cast mouse coordinates from float to int before gRPC call#579
Closed
Gourav7389 wants to merge 1 commit intosiemens:nextfrom
Closed
fix(www): cast mouse coordinates from float to int before gRPC call#579Gourav7389 wants to merge 1 commit intosiemens:nextfrom
Gourav7389 wants to merge 1 commit intosiemens:nextfrom
Conversation
baprusty
reviewed
Apr 13, 2026
Browser sends normalized float coordinates (e.g. 0.334), which were passed directly to the proto int32 field causing a TypeError. Wrapping with int(float(...)) fixes the crash. Signed-off-by: Gourav Singh <gouravsingh@siemens.com>
ef9db31 to
5f1f175
Compare
chombourger
reviewed
Apr 13, 2026
| sid = self.get_argument('session', None) | ||
| x = float(self.get_argument("x", 0)) | ||
| y = float(self.get_argument("y", 0)) | ||
| x = int(float(self.get_argument("x", 0)) * CONSTS.MOUSE.MAX_X) |
Collaborator
There was a problem hiding this comment.
this would cause a double-scaling bug. I would suggest we correct the proto instead (we can accept some signature change). What do you think @fmoessbauer ?
I raised #580
Member
There was a problem hiding this comment.
I also vote for changing the proto. This is not widely used yet, so better change it now than later.
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.
Browser sends normalized float coordinates (e.g. 0.334), which were passed directly to the proto int32 field causing a TypeError. Wrapping with int(float(...)) fixes the crash.