Skip to content
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

vscode-trace-extension not working with latest trace-viewer depenencies #35

Closed
bhufmann opened this issue Jan 14, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@bhufmann
Copy link
Collaborator

bhufmann commented Jan 14, 2022

With the recent updates in the trace viewer components and its dependencies to use BigInt for timestamps, the serialization of messages between the webviews and vscode extension will fail because the standard json serializer doesn't support type BigInt.

It will fail with the following message:

TypeError: Do not know how to serialize a BigInt
/usr/share/code/resources/app/out/bootstrap-fork.js:5
stack trace: TypeError: Do not know how to serialize a BigInt
	at JSON.stringify (<anonymous>)
	at y (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:3480)
	at g.postMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:96:73489)
	at TraceViewerPanel.setExperiment (/home/eedbhu/git/vscode-trace-extension/vscode-trace-extension/lib/trace-viewer-panel/trace-viewer-webview-panel.js:125:29)
	at /home/eedbhu/git/vscode-trace-extension/vscode-trace-extension/lib/trace-explorer/trace-tree.js:123:19
	at processTicksAndRejections (internal/process/task_queues.js:93:5)

For example the Experiment or Trace classes contain timestamp fields which are BigInt and causing serialization problems and the vscode trace extension to fail.

To fix this, each message send between webviews and the vscode trace extension itself need to be updated that BigInt values are serialized properly (e.g. using a string) and deserialized to BigInt on the receiving side.

This issue needs to be fixed before upgrading to the latest traceviewer components which contain many valuable improvements.

@bhufmann bhufmann added the bug Something isn't working label Jan 14, 2022
@bhufmann
Copy link
Collaborator Author

bhufmann commented Sep 7, 2022

Using eclipse-cdt-cloud/tsp-typescript-client#56, the serialization / deserialization of BigInt values can be achieved when sending/receiving signals.

bhufmann added a commit to bhufmann/vscode-trace-extension that referenced this issue Sep 14, 2022
TODO: JSONBig.parse() doesn't create bigint if numbers are small. This
has to be addressed when deserializing messages. Re-use the normalizer
of the tsp-typescript-client to do that.

The following branch in the tps-typescript-client is introducing an
utility class and, if accepted, it can be used to solve the
deserialization issue:

eclipse-cdt-cloud/tsp-typescript-client#56

Contributes to fixing eclipse-cdt-cloud#35

Signed-off-by: Bernd Hufmann <[email protected]>
bhufmann added a commit to bhufmann/vscode-trace-extension that referenced this issue Sep 15, 2022
TODO: JSONBig.parse() doesn't create bigint if numbers are small. This
has to be addressed when deserializing messages. Re-use the normalizer
of the tsp-typescript-client to do that.

The following branch in the tps-typescript-client is introducing an
utility class and, if accepted, it can be used to solve the
deserialization issue:

eclipse-cdt-cloud/tsp-typescript-client#56

Contributes to fixing eclipse-cdt-cloud#35

Signed-off-by: Bernd Hufmann <[email protected]>
bhufmann added a commit to bhufmann/vscode-trace-extension that referenced this issue Sep 16, 2022
TODO: JSONBig.parse() doesn't create bigint if numbers are small. This
has to be addressed when deserializing messages. Re-use the normalizer
of the tsp-typescript-client to do that.

The following branch in the tps-typescript-client is introducing an
utility class and, if accepted, it can be used to solve the
deserialization issue:

eclipse-cdt-cloud/tsp-typescript-client#56

Contributes to fixing eclipse-cdt-cloud#35

Signed-off-by: Bernd Hufmann <[email protected]>
bhufmann added a commit to bhufmann/vscode-trace-extension that referenced this issue Sep 22, 2022
TODO: JSONBig.parse() doesn't create bigint if numbers are small. This
has to be addressed when deserializing messages. Re-use the normalizer
of the tsp-typescript-client to do that.

The following branch in the tps-typescript-client is introducing an
utility class and, if accepted, it can be used to solve the
deserialization issue:

eclipse-cdt-cloud/tsp-typescript-client#56

Contributes to fixing eclipse-cdt-cloud#35

Signed-off-by: Bernd Hufmann <[email protected]>
bhufmann added a commit that referenced this issue Sep 23, 2022
TODO: JSONBig.parse() doesn't create bigint if numbers are small. This
has to be addressed when deserializing messages. Re-use the normalizer
of the tsp-typescript-client to do that.

The following branch in the tps-typescript-client is introducing an
utility class and, if accepted, it can be used to solve the
deserialization issue:

eclipse-cdt-cloud/tsp-typescript-client#56

Contributes to fixing #35

Signed-off-by: Bernd Hufmann <[email protected]>
bhufmann added a commit to bhufmann/vscode-trace-extension that referenced this issue Sep 26, 2022
bhufmann added a commit that referenced this issue Sep 30, 2022
@bhufmann
Copy link
Collaborator Author

bhufmann commented Oct 3, 2022

The extension works now with:

  • traceviewer-base: 0.2.0-next.7298b48.0
  • traceviewer-react-components: "0.2.0-next.7298b48.0"

Serialization is fixed for experiments and it's not an issue for data provider descriptors. Closing this one and open a ticker for improved and more generic serialization implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant