Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Conversation

@patrickt
Copy link
Contributor

@patrickt patrickt commented Jul 2, 2019

As reported in #189, the edges field of JSON graph output refers to
information not reflected in the rest of the output, specifically the
vertex IDs. This patch adds that information to the ToJSON instance
for ControlFlowVertex. It also includes a toEncoding instance for
a free speed boost.

During this patch, I realized that, because hash tends to return a
large number (since Int is 64-bit), we may run into errors when
decoding JSON. One example hash is 3500157981503982114; passing that
to a JS engine's Number.isSafeInteger function returns false. The
correct thing to do here is return ids as strings, which I have done.
This is backwards-incompatible, but since this information was never
properly exposed, the impact is negligable.

As reported in #189, the `edges` field of JSON graph output refers to
information not reflected in the rest of the output, specifically the
vertex IDs. This patch adds that information to the `ToJSON` instance
for `ControlFlowVertex`. It also includes a `toEncoding` instance for
a free speed boost.

During this patch, I realized that, because `hash` tends to return a
large number (since `Int` is 64-bit), we may run into errors when
decoding JSON. One example hash is `3500157981503982114`; passing that
to a JS engine's `Number.isSafeInteger` function returns false. The
correct thing to do here is return ids as strings, which I have done.
This is backwards-incompatible, but since this information was never
properly exposed, the impact is negligable.
@patrickt
Copy link
Contributor Author

patrickt commented Jul 2, 2019

Fixes #189.

@patrickt patrickt requested a review from a team July 2, 2019 16:48
@robrix robrix merged commit d147bb8 into master Jul 2, 2019
@robrix robrix deleted the fix-graph-vertex-ids branch July 2, 2019 21:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants