You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah! This is because of the way we calculate hashes for cells. We are a bit inconsistent, actually.
In javascript.ts we have:
let allHash = Md5.hashStr(antecedents.map(a => a.hash).join("-") + source)
This concatenates all hashes of all dependencies and also the source code and hashes that. This is perfect, because if source code or dependency changes, we get a new hash - so changing some code that this cell depends on would also invalidate the cache.
In external.ts we have the same in bind when constructing node:
let allHash = Md5.hashStr(antecedents.map(a => a.hash).join("-") + exBlock.source)
However, we use wrong hash in the evaluate operation. In line 199 we have:
let hash = Md5.hashStr(src)
// And we use this hash later in:
let body = {"code": strippedSrc,
"hash": hash,
"files" : importedFiles,
"frames": importedFrames}
This only hashes the current source code, so if an antecedent changes, we will use wrong cached result.
We should not be computing hash in evaluate at all - we already computed (a correct) one when doing bind so we can just use that - this should be accessible in externalNode.hash.
TLDR - replacing hash on line 227 with externalNode.hash should fix the issue!
When Radka makes a change to previous cells, she cannot force-evaluate current cell because it refers to cache.
The text was updated successfully, but these errors were encountered: