Remove dangerous FlagValueDictionary functionality
📒 Description
Remove dangerous FlagValueDictionary functionality:
- It's internally locked, so not safe for it to conform to Collection
- It's a reference type, so shouldn't conform to Equatable
🔍 Detailed Design
Include any additional information about the design here. At minimum, show any new API:
... FlagValueDictionary {
// MARK: - Dictionary Access
/// Returns a copy of the current values in this source
var allValues: DictionaryType { get }
}
📓 Documentation Plan
I noticed CustomSources.md is outdated with the new FlagValueSource/NonSendableFlagValueSource split, but updating that seems to be a separate task.
🗳 Test Plan
Unit tests.
🧯 Source Impact
-
Removes FlagValueDictionary's conformance to Collection. This is a breaking change. Existing users of this conformance will need to use
allValues, but that alone can't replace all uses of the Collection API. I didn't want to makeallValuesa mutable property though, because that would reintroduce the same kinds of unsafety that the Collection conformance did. -
Removes FlagValueDictionary's conformance to Equatable. This is a breaking change. Existing users of this conformance will need to check
sourceA.id == sourceB.id && sourceA.allValues == sourceB.allValuesto get an equivalent check (and also be aware that they may have a race condition since the FVD isSendable)
✅ Checklist
- [x] I've added at least one test that validates that my change is working, if appropriate
- [x] I've followed the code style of the rest of the project
- [x] I've read the Contribution Guidelines
- [x] I've updated the documentation if necessary
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code