State serialization can collapse distinct dictionary keys
- Dominant language
- Scala
- Stars
- 314
- Forks
- 187
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 214
Description
### Feature Summary
State serialization converts every dictionary key to a string. Distinct Python keys can therefore collapse to the same JSON key and silently overwrite state.
Before: integer key 1 and string key 1 -> one stored value survives
After: any non-string state key -> TypeError before serialization
Reproduction evidence:
Round-trip state containing a nested dictionary with integer key 1 and string key 1.
Version and commit evidence:
1.3.0-incubating-SNAPSHOT (main)
**Commit Hash**
70c21145887920528d7d5540e3fb790b43e8b759
**What browsers are you seeing the problem on?**
Not browser-specific.
**Relevant log output**
```text
original= {'config': {1: 'integer key', '1': 'string key'}}
encoded= {"config":{"1":"string key"}}
round_trip_equal= False
```
### Proposed Solution or Design
After: any non-string state key -> TypeError before serialization
### Affected Area
Workflow Engine (Amber)
Contributor guide
Assessment
This issue has not been assessed yet.