Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al  ·  activity timestamp 2 hours ago

So guess who wrote a convoluted date comparison conditional instead of using `Temporal.ZonedDateTime.compare()` like an intelligent human being and ended up hitting an edge case where future scheduled calls started getting cleaned off the database instead of past ones?

I’ll give you a hint: has two thumbs and his name is Aral 🤦‍♂️

Anyway, just restored things from yesterday’s backup and sent a direct message to everyone scheduled for a Gaza Verified video verification call apologising for the confusion and explaining what happened.

Moral of the story: stick to the Temporal API and use its methods if you’re implementing anything even remotely non-trivial involving dates, especially if there are timezones involved. (You can use a Temporal API polyfill in Node.js – I’ve been using temporal-polyfill.)

Now I’m going to expire for the evening.

💕

#GazaVerified #TemporalAPI #calendars #dates #timezones #JavaScript #NodeJS

  • Copy link
  • Flag this post
  • Block
woe2you
woe2you
@woe2you@beige.party replied  ·  activity timestamp 2 hours ago

@aral Isn't timezone handling #2 on the Do Not Roll Your Own list, right after cryptography?

  • Copy link
  • Flag this comment
  • Block
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al replied  ·  activity timestamp 2 hours ago

@woe2you Oh, I didn’t roll my own (that’s why I was using the Temporal API, which is excellent). This was just one date comparison where past me clearly tried to be overly clever :)

  • Copy link
  • Flag this comment
  • Block
woe2you
woe2you
@woe2you@beige.party replied  ·  activity timestamp 2 hours ago

@aral That guy is always causing problems. You should fire him and give his job to future-Aral. At least he's never committed anything broken.

  • Copy link
  • Flag this comment
  • Block
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al replied  ·  activity timestamp 1 hour ago

@woe2you I know, right, what a dickhead :)

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct