Fix: metadata update issue (#12815)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2026-01-26 18:02:44 +08:00
committed by GitHub
parent 1d93519cb2
commit e20d56a34c

View File

@ -675,8 +675,7 @@ class DocumentService(CommonService):
if k not in old:
old[k] = v
continue
if isinstance(v, dict):
assert isinstance(old[k], dict)
if isinstance(v, dict) and isinstance(old[k], dict):
dfs_update(old[k], v)
else:
old[k] = v
@ -863,11 +862,9 @@ class DocumentService(CommonService):
key = upd.get("key")
if not key:
continue
if key not in meta:
meta[key] = upd.get("value")
new_value = upd.get("value")
match_provided = "match" in upd
match_provided = upd.get("match")
if key not in meta:
if match_provided:
continue
@ -880,7 +877,7 @@ class DocumentService(CommonService):
if isinstance(new_value, list):
meta[key] = dedupe_list(new_value)
else:
meta[key] = new_value
meta[key].append(new_value)
changed = True
else:
match_value = upd.get("match")