-
Notifications
You must be signed in to change notification settings - Fork 345
Description
The hashes stored to trust store in trustNotebook
are not the same as the hashes computed when checking isNotebookTrusted
. This used to work before, the main difference is we're now using I did a comparison of the contents that are being hashed in a debugger and they look the same, so could be an encoding issue? End result is that notebooks are trusted with one hash but checked for trust with a different hash, i.e. user-trusted notebooks are always untrusted on next loadmodel.getContent()
to retrieve the current notebook contents.
ETA: model.getContent() returns stringified notebook contents that differ from what's actually stored on disk. This is the root cause of the problem. A proper fix for this would ensure that getContent() returns data that is identical to what's on disk
ETA to the ETA: There are actually two separate problems. The first is that getContent() sometimes unnecessarily reorders the JSON. The second is that JSON.parse converts escaped unicode characters to actual unicode, so the constructed model will differ from the actual file contents on disk until the user hits save
/cc @DonJayamanne