From 0f833669a4eec9b293093bf0ba27c8ded3da6d7c Mon Sep 17 00:00:00 2001 From: Alexandre Neuwald CTW <162589552+aneuwald-ctw@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:33:24 +0100 Subject: [PATCH] [BUGFIX] State Transitions panel is crashing with "RPC Terminated" error (#31) **User-Facing Changes** The default layout of ADP was not functioning correctly. The "State Transitions" panel was crashing due to a re-render problem, causing an RPC to be created and closed twice with the same ID. This led to a message being sent during the process, resulting in the exception "RPC terminated." **Description** A complete solution for the problem was not identified, suggesting the issue might stem from a deeper component such as the LayoutManager. Instead of resolving the root cause, the error has been suppressed. A lost message to a closed RPC is not critical since the new RPC operates correctly. However, this issue should be revisited in the future for a more thorough fix. **Checklist** - [x] The web version was tested and it is running ok - [x] The desktop version was tested and it is running ok - [ ] I've updated/created the storybook file(s) - [x] The release version was updated on package.json files --- package.json | 2 +- packages/studio-base/src/components/Chart/index.tsx | 8 +++++--- packages/studio/package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d04d7cf604..d3dea08601 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foxbox", - "version": "1.0.4", + "version": "1.0.5", "license": "MPL-2.0", "private": true, "productName": "Foxbox", diff --git a/packages/studio-base/src/components/Chart/index.tsx b/packages/studio-base/src/components/Chart/index.tsx index 268537fea0..40cc66750d 100644 --- a/packages/studio-base/src/components/Chart/index.tsx +++ b/packages/studio-base/src/components/Chart/index.tsx @@ -351,10 +351,12 @@ function Chart(props: Props): JSX.Element { return; } + // Temporarily remove setUpdateError to avoid displaying the error caused by re-rendering, + // which results in the component crashing. The crash happens because a message is sent to a + // closed RPC, causing some panels to become unusable. This approach ignores the error to + // keep the component functional. Revisit this once the underlying issue is resolved. updateChart(newUpdate).catch((err: Error) => { - if (isMounted()) { - setUpdateError(err); - } + console.error(err); }); }, [getNewUpdateMessage, isMounted, updateChart]); diff --git a/packages/studio/package.json b/packages/studio/package.json index 06aab62f9f..770eadf15a 100644 --- a/packages/studio/package.json +++ b/packages/studio/package.json @@ -1,6 +1,6 @@ { "name": "@foxglove/studio", - "version": "1.0.4", + "version": "1.0.5", "license": "MPL-2.0", "repository": { "type": "git",