forked from eclipse-theia/theia
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve RPC message encoding (eclipse-theia#11294)
* Improve RPC message encoding - Refactor `RPCMessageEncoder` to enable detection of circular object structures. Circular structures can not be serialized. The detection enables us to fail early instead of indirectly failing once the maximum stack frame limit is reached. - Add a custom encoder for functions. This ensures that direct function entries in arrays can be serialized. - Add custom encoder for common collection types (maps, sets). Enables direct use of collection types as rpc call arguments (e.g. logging statements) - Restore behavior of the old protocol if a log RPC call can not be sent to the backend due to an encoding error - Add custom `EncodingError` type to explicitly catch these errors - Refactor `loggerFrontendModule` to catch encoding errors and continue execution normally. i.e. log call is just logged in frontend console and not sent to backend Fixes eclipse-theia#11249 Contributed on behalf of STMicroelectronics * Address review feedback - Remove default value for `visitedObjects` parameter - Move circular reference check from the `object` value encoder into `wirteTypeValue` to ensure that all the ciruclar reference check is applied on all object references
- Loading branch information
Showing
3 changed files
with
105 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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