decent-chat / decent

Open source messaging platform for the modern web
https://meta.decent.chat
GNU General Public License v3.0
21 stars 5 forks source link

1.0.0 impl: various datetime fixes #299

Closed bates64 closed 6 years ago

bates64 commented 6 years ago
towerofnix commented 6 years ago

We now store dates to millisecond-level accuracy, however the serialize functions floor the value before they are outputted by the API.

Why?

We're a chat service. This means people send messages quickly - very often multiple times in a single second. Why should we prevent the user (or developers) from knowing the order of messages that came within a single second?

I know that some languages have int types which are separate from floats, but they can just convert the values to integers, if they really need to.

bates64 commented 6 years ago

Why should we prevent the user (or developers) from knowing the order of messages that came within a single second?

Unix time is standard. Date.now() is not. The milliseconds float thing should be specified in the API as a recommended (but not required) practice imo. Serialize shouldn't floor :+1:

PullJosh commented 6 years ago

How many programming languages do not give a way to tell the current millisecond?

When we write a server implementation in BF, we'll have a bit of thinking to do...