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

Should message dates *really* not be to the millsecond? #297

Closed towerofnix closed 6 years ago

towerofnix commented 6 years ago

Right now some tests are failing because the order of messages sent in the same second isn't obvious to the server - as far as it's concerned, those messages were sent within the same instant. And they were sent in the same unit of time - since our unit of time is whole seconds.

Would it be okay to simply remove the Math.rounding of (javascript date) / 1000? That would keep the accuracy to the millisecond, but still use seconds as the unit equal to 1.

Ping @heyitsmeuralex for thoughts; this is an extremely easy fix.

PullJosh commented 6 years ago

Not an expert, but more accuracy seems better. And it's not like that should affect clients at all. They can show times however they'd like.

bates64 commented 6 years ago

Provided the API docs continue to use Unix time (ie. seconds), I'm fine with it. You can return a float if you really want to in the API - dateCreated: 1500008.125 is okay.