data
serialization
ai_generated
true
Timestamp deserialization fails — msgpack extension type mismatch across languages
ID: data/msgpack-timestamp-extension-incompatible
80%Fix Rate
85%Confidence
4Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
MessagePack timestamp extension type -1 is not supported uniformly across implementations.
genericWorkarounds
-
92% success Serialize timestamps as Unix epoch integers
int(datetime.now().timestamp()) -- universally supported
Sources: https://github.com/msgpack/msgpack/blob/master/spec.md
-
82% success Use explicit extension type registration on both sides
msgpack.packb(data, default=encode_datetime); msgpack.unpackb(raw, ext_hook=decode_datetime)
Sources: https://msgpack-python.readthedocs.io/en/latest/api.html
Dead Ends
Common approaches that don't work:
-
Assume all msgpack libraries support timestamp extension type
85% fail
Older or minimal implementations may not support the timestamp extension
-
Convert timestamps to strings before packing
65% fail
String timestamps are larger and defeat msgpack binary efficiency