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

Fix: trackable data types stored into DataNode.value causing encoding errors #665

Open
2 tasks
Domiii opened this issue Feb 9, 2022 · 0 comments
Open
2 tasks
Assignees
Labels
bug Something isn't working priority small This issue should not take a lot of code or time to fix.

Comments

@Domiii
Copy link
Owner

Domiii commented Feb 9, 2022

Notes:

  • Problem: shelljs has a ShellString object data type that sets its prototype to String, causing valueCollection to miscategorize it.
  • ShellString is defined here.
  • The encoder uses Object.keys to iterate over props
  • The encoder has the following logic for objects:
          if (typeof object === "string") {
              this.encodeString(object);
          }
          else {
              this.encodeObject(object, depth);
          }
  • because that is different from how we detect things, ShellStrings get classified as "non-trackable" and thus their value is stored as-is into DataNode, via valueCollection.registerValueMaybe.

TODO

  • fix our object detection mechanism, or simply add an extra serialization step before storing plain values on DataNode
  • test w/ require4.js
@Domiii Domiii added bug Something isn't working priority labels Feb 9, 2022
@Domiii Domiii self-assigned this Feb 9, 2022
@Domiii Domiii added the small This issue should not take a lot of code or time to fix. label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority small This issue should not take a lot of code or time to fix.
Projects
None yet
Development

No branches or pull requests

1 participant