Web: a replaced file goes to reused workers again, even at the same size (#218)
Job workers remembered the files they were sent by path and byte length, so footage replaced by different bytes of the same length at the same path was never resent: a Render Queue export through a reused worker rendered the old image while the page showed the new one. Frame workers remembered paths only, so they never got a replacement at all. Every write of a stored file now gets a version, and both kinds of worker remember the version they were sent. Tests: versions_change_with_every_write (store) and apps/effectcraft-web/tests/workers.mjs (Node, fake Worker: the replacement is sent once, an unchanged file not again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gnTnH3Jmk5zr4tMq1Mc9f
This commit is contained in:
@@ -60,8 +60,8 @@ impl Offload for WorkerOffload {
|
||||
let id = req.id;
|
||||
let files = js_sys::Array::new();
|
||||
for p in &req.files {
|
||||
if let Some(d) = crate::files::get(p) {
|
||||
files.push(&js_sys::Array::of2(&JsValue::from_str(p), &js_sys::Uint8Array::from(&d[..])));
|
||||
if let Some((d, version)) = crate::files::get_versioned(p) {
|
||||
files.push(&js_sys::Array::of3(&JsValue::from_str(p), &js_sys::Uint8Array::from(&d[..]), &JsValue::from_f64(version as f64)));
|
||||
}
|
||||
}
|
||||
let json = serde_json::to_string(&req).map_err(|e| e.to_string())?;
|
||||
|
||||
Reference in New Issue
Block a user