fix(js): release parallel pending state
When data-slhx-policy=parallel runs overlapping requests against one target, release pending UI bookkeeping for each completed request instead of only the last pending handle. req: convention/006 req: convention/007 req: convention/008
This commit is contained in:
@@ -214,6 +214,8 @@
|
|||||||
if (pending.get(target)?.abort === abort) {
|
if (pending.get(target)?.abort === abort) {
|
||||||
pending.delete(target);
|
pending.delete(target);
|
||||||
showPending(target, false);
|
showPending(target, false);
|
||||||
|
} else if (policy === "parallel") {
|
||||||
|
showPending(target, false);
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,6 +152,17 @@ fn runtime_latest_request_policy_releases_superseded_pending_state() {
|
|||||||
assert!(source.contains("if (pending.get(target)?.abort === abort)"));
|
assert!(source.contains("if (pending.get(target)?.abort === abort)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn runtime_parallel_request_policy_releases_each_pending_state() {
|
||||||
|
// req: convention/006 req: convention/007 req: convention/008
|
||||||
|
let source = slhx_js::RUNTIME_JS;
|
||||||
|
|
||||||
|
assert!(source.contains("else if (policy === \"parallel\") {\n showPending(target, false);\n }"));
|
||||||
|
assert!(source.contains("const pendingClassStates = new WeakMap()"));
|
||||||
|
assert!(source.contains("const indicatorStates = new WeakMap()"));
|
||||||
|
assert!(source.contains("const disabledStates = new WeakMap()"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn runtime_exposes_page_swap_hooks() {
|
fn runtime_exposes_page_swap_hooks() {
|
||||||
let source = slhx_js::RUNTIME_JS;
|
let source = slhx_js::RUNTIME_JS;
|
||||||
|
|||||||
Reference in New Issue
Block a user