automerge / automerge-swift

Swift language bindings presenting Automerge

Home Page:https://automerge.org/automerge-swift/documentation/automerge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timestamp

lightsprint09 opened this issue · comments

The old automerge-swift stored Timestamp in milliseconds (not sure why), resulting in wrong resulting Dates when importing it with the new automerge-swift. Any idea we can mitigate this?

It would require changes to the Automerge core - I'm uncertain on why it changed, exactly. I considered a transformation that preserved a Double (Date's internal TimeInterval type) from 1970 epoch, but in some ways that's even more oblique, and clearly doesn't map to the internal Automerge representation which has less granular resolution, so it didn't seem to offer any cross-platform benefit.

@alexjg - any insight into the change in internal Automerge representation of Value.Timestamp?

I guess the old auto merge implemented it wrong

I think this is actually a case where we got it wrong in the Swift implementation. The rest of the automerge implementations use milliseconds since the epoch.

Ideally we would update the swift implementation (which I think just corresponds to changing the documentation?).

So the new implementation is missing this piece of code?