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

fromJSON lost class information #79

Closed
huan opened this issue May 14, 2022 · 1 comment
Closed

fromJSON lost class information #79

huan opened this issue May 14, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@huan
Copy link
Owner

huan commented May 14, 2022

Thanks for your unit test; it's very helpful.

With your code, I am able to reproduce the bug, and it's related to the FileBox.fromJSON() method.

Here's the minimum reproducible code for FileBox:

test('message file test', async t => {
  const JSON_TEXT = '{"metadata":{},"name":"smoke-testing.ts","size":735,"type":7,"uuid":"82f461b9-e654-422d-aade-222d05cb02ad","boxType":7}'
  const FileBoxUuid = uuidifyFileBoxGrpc(() => ({} as any))
  const fileBoxUuid = FileBoxUuid.fromJSON(JSON_TEXT)
  t.equal(instanceToClass(fileBoxUuid, FileBox), FileBoxUuid, 'should get back FileBoxUuid class')
})

Originally posted by @huan in wechaty/puppet-service#206 (comment)

huan added a commit that referenced this issue May 14, 2022
@huan huan added the bug Something isn't working label May 14, 2022
@huan
Copy link
Owner Author

huan commented May 14, 2022

Fixed by the commit.

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