Repository navigation
fix: tolerate duplicate flag keys in data sync payload - #33
dmytrodanilenkov wants to merge 1 commit into
Conversation
DataModel.Data.toStorageType() built an ImmutableMap keyed by flag key, so a payload with the same key twice (e.g. featbit-agent still holding an archived copy of a flag that was deleted and re-created) threw "Multiple entries with same key" and failed the whole sync, leaving new clients in a reconnect loop. Collect items into a LinkedHashMap so the last entry wins, as the Go, Python, Rust, Ruby and Node SDKs already do.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Fixes #32
DataModel.Data.toStorageType() built an ImmutableMap keyed by flag key, so a payload with the same key twice (e.g. featbit-agent still holding an archived copy of a flag that was deleted and re-created) threw "Multiple entries with same key" and failed the whole sync, leaving new clients in a reconnect loop.
Collect items into a LinkedHashMap so the last entry wins, as the Go, Python, Rust, Ruby and Node SDKs already do.


Confidence Score: 5/5
This PR appears safe to merge.Summary
The PR lets data sync accept repeated flag keys and segment IDs instead of throwing an exception.
Reviews (1) · Last reviewed commit: "fix: tolerate duplicate flag keys in dat..." · Reviewed by Greptile
Summary by CodeRabbit