-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update monitor settings only if it's changed #1703
Conversation
@kittaakos: I tried this commit in my branch, and it seems to work great. The only remaining issue in the IDE with #375 is that, when you change the baud rate from the serial monitor pulldown, there are still 6 CONFIGURE commands sent out instead of only the one for the baud rate. I believe the issue is here: https://github.com/arduino/arduino-ide/blob/theia-1.31.1/arduino-ide-extension/src/browser/serial/monitor/monitor-widget.tsx#L237 Instead of only sending the baud rate, it looks like this code grabs all the serial settings, updates the baud rate, and then sends them all out. I tested the serial-plotter as well, and it acts the same way when you change the baud rate. |
0a67591
to
2d5df27
Compare
Thank you for the handy input, @palazzol 💪 Could you please check the tester build from my updated PR? I completely rewrote my proposed changes: this time, IDE2 calculates a diff of monitor settings and sends only a diff of configuration commands. Thank you! When starting the monitor, IDE2 sends the configure commands:
When changing the baud rate, only the baud rate is configured:
When changing the line ending, it's a NOOP:
|
I tried the tester build and it seems to work very well - thanks for doing this! I do find it odd that when changing one parameter, the information about which parameter has changed gets "lost" somehow and needs to be regenerated by diffing at another level. But, I don't really understand to full communications path - and these changes do seem to fix the issue. |
Great!
You provided excellent support and helped me understand the problem. I appreciate your help.
I agree. IDE2 deserves better logic. I am unfamiliar with the monitor code, but I wanted to chime in after your #1677 (comment). I am happy we could find a point where we can work around the bug without eventually changing the monitor behavior. |
Closes #375 Signed-off-by: Akos Kitta <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM code-wise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this fixes one component of #375
changing the selection in the line ending menu triggers the immediate sending of additional spurious data in addition to the regular periodic data reported above.
I notice the same happens when you toggle the "Toggle Autoscroll" or "Toggle Timestamp" icons.
The other component of #375, where spurious data is sent periodically even without a settings change has been fixed upstream via bugst/go-serial#147 + arduino/serial-monitor#31 and will reach Arduino IDE 2.x users without any need for action in this repository once the next release of serial-monitor is made.
Thanks Akos and @palazzol!
Depends on #1662
Motivation
Do not send monitor settings changes when there are no settings updates.
Change description
I wanted to keep the changeset as small as possible. From now on,
setSettings
promise resolves withundefined
if there are no effective monitor settings updates. In such a case, the IDE2 monitor service does not send aMonitorRequest
to the CLI.Other information
Closes #375
Reviewer checklist