When two profile files declare the same id, the by-id index keeps the last file loaded, while GetById(id, source) scans and returns the first match. The two disagree, so which profile is actually used depends on which path the caller took.
The settings override key is "Id:Source" with no filename component, so a user with two same-id profiles cannot disambiguate them. This currently produces only a warning at load.
This has already cost real debugging time: a hardware test in a previous investigation silently ran under a different profile than intended, for exactly this reason.
Fix direction: require ids to be unique within a source, reject later same-source duplicates deterministically rather than by directory enumeration order, and log both filenames so the warning is actionable.
Acceptance: every lookup and deletion path resolves to the same profile regardless of the order the directory is enumerated in.
When two profile files declare the same
id, the by-id index keeps the last file loaded, whileGetById(id, source)scans and returns the first match. The two disagree, so which profile is actually used depends on which path the caller took.The settings override key is
"Id:Source"with no filename component, so a user with two same-id profiles cannot disambiguate them. This currently produces only a warning at load.This has already cost real debugging time: a hardware test in a previous investigation silently ran under a different profile than intended, for exactly this reason.
Fix direction: require ids to be unique within a source, reject later same-source duplicates deterministically rather than by directory enumeration order, and log both filenames so the warning is actionable.
Acceptance: every lookup and deletion path resolves to the same profile regardless of the order the directory is enumerated in.