mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-08-15 23:20:29 +02:00
fix(store): preserve non-mapping native layer entries (#508)
* fix(store): preserve non-mapping native layer entries * test(store): cover mixed native injection cleanup
This commit is contained in:
@@ -141,7 +141,11 @@ def inject_layer_data(
|
||||
existing = list(current) if isinstance(current, list) else []
|
||||
|
||||
if mode == "replace":
|
||||
existing = [e for e in existing if not e.get("_injected")]
|
||||
existing = [
|
||||
entry
|
||||
for entry in existing
|
||||
if not (isinstance(entry, dict) and entry.get("_injected"))
|
||||
]
|
||||
|
||||
# Readers can hold references to published layer lists after releasing
|
||||
# _data_lock. Build a fresh list and swap it atomically rather than
|
||||
@@ -170,7 +174,11 @@ def clear_injected_data(layer: str = "") -> dict[str, Any]:
|
||||
if not isinstance(existing, list):
|
||||
continue
|
||||
before = len(existing)
|
||||
latest_data[lyr] = [e for e in existing if not e.get("_injected")]
|
||||
latest_data[lyr] = [
|
||||
entry
|
||||
for entry in existing
|
||||
if not (isinstance(entry, dict) and entry.get("_injected"))
|
||||
]
|
||||
removed += before - len(latest_data[lyr])
|
||||
|
||||
if removed:
|
||||
|
||||
Reference in New Issue
Block a user