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

Create a test passing in an ESR payload w/ meta data and ensure metadata persists #18

Closed
aaroncox opened this issue Jan 2, 2023 · 0 comments
Milestone

Comments

@aaroncox
Copy link
Member

aaroncox commented Jan 2, 2023

I'm not sure if when you pass in an ESR payload, that the metadata will persist. The createRequest method takes the request body and creates a new SigningRequest object with it, which may disregard all the old information it contained.

https://github.com/wharfkit/session/blob/dev/src/session.ts#L291-L321

A test should be added that passes a request with metadata, and then ensures the metadata makes it through the entire process.

If it doesn't, then perhaps we need to clone the request instead of creating a new one?

@aaroncox aaroncox added this to the 0.2.0 milestone Jan 10, 2023
aaroncox added a commit that referenced this issue Jan 17, 2023
Resolves #18.

This new update method ensures the metadata from the original request will persist through modification by a `beforeSign` plugin.

The original metadata will take precedent over metadata from the new request, ensuring no plugin upstream can overwrite it. A warning will be displayed when this happens to let the developer know.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant