flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.17k stars 90 forks source link

bug repro with dedupe=true #253

Closed KATT closed 1 year ago

KATT commented 1 year ago

We found a bug with dedupe option.

I'm sorry for this repro, it's awful and huge and bloated. Haven't narrowed it down more, but AFAICT, the results of these should be equal but they aren't.

The problem shows in the diff between non-deduped and deduped; some values stay as null after deserializing the deduped one.

Skn0tt commented 1 year ago

Finally got around to take a look at this. It was a nifty small bug, definitely a fun sherlocking adventure! :D

I put some prose as to what's happening into the test in https://github.com/blitz-js/superjson/pull/253/commits/593841d5901f2d4409865e11122843b6745350e9, if you're curious.

Skn0tt commented 1 year ago

released in https://github.com/blitz-js/superjson/releases/tag/v1.13.3