Skip to content

Conversation

karthik2804
Copy link
Collaborator

Fixes a couple of small bugs that I ran into.

  • We were not handling the case ArrayBuffer properly in KV set operations.
  • The responses returned by starlingMonkey were cyclic, and routers like Itty threw errors when trying to go from an error to a response. This fix now extracts the useful parts of the error and wraps them up in a simpler JS error.

@karthik2804
Copy link
Collaborator Author

@tschneidereit I am not really sure about the error part and wonder if handling the error should be a user concern instead of us wrapping it.

Copy link
Collaborator

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's an okay workaround, yes. It's somewhat unfortunate that the generated bindings have cyclic structures, but we should look into tackling that with the move to wit-dylib in time.

Comment on lines +62 to +63
} else if (value instanceof ArrayBuffer) {
value = new Uint8Array(value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiniest of nits: I would move this to the top so the encode cases stay grouped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants