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

Node removes key/value from object when passing to function #29328

Closed
gorgos opened this issue Aug 27, 2019 · 2 comments
Closed

Node removes key/value from object when passing to function #29328

gorgos opened this issue Aug 27, 2019 · 2 comments

Comments

@gorgos
Copy link

gorgos commented Aug 27, 2019

  • Version: v11.13.0
  • Platform: Windows 10 Pro 1903 64-bit
  • Subsystem: ConEmu + Git Bash
  • Uname -a: MINGW64_NT-10.0 DESKTOP-LIIEHJM 2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys
const execute = async tmpAfter => {
  console.log({ tmpAfter })
}

const tmpBefore = {
  maxUserCount: USER_COUNT,
  myJuriNodeAddress: nodes[nodeIndex].address,
  myJuriNodePrivateKey: nodes[nodeIndex].privateKeyBuffer,
  nodeIndex,
  wasCompliantData,
  failureOptions: {
    isNotRevealing: notRevealingConfig[nodeIndex],
    isSendingIncorrectResult: incorrectResultConfig[nodeIndex],
    isOffline: offlineConfig[nodeIndex],
    isSendingIncorrectDissent: incorrectDissentConfig[nodeIndex],
  },
}

console.log({ tmpBefore })
execute(tmpBefore)

->

{ tmpBefore: { [-as expected-] } }
{ tmpAfter: { [-as tmpBefore but without maxUserCount-] } }

I can add any new key + value and it doesn't get passed. But I can change the other keys and they update correctly. Some strange caching error I guess. Will try a reboot.

Update: Reboot did not fix it.

@mscdex
Copy link
Contributor

mscdex commented Aug 27, 2019

Do you have a more self-contained example? Can you test with the latest node v12.x?

@gorgos
Copy link
Author

gorgos commented Aug 27, 2019

A reboot of my brain helped. I had a hidden wrapper around execute which didn't pass the maxUserCount key/value. 🤦‍♂

@gorgos gorgos closed this as completed Aug 27, 2019
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

2 participants