Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

#как-мы-решили

Reset

1 post tagged #как-мы-решили: articles, how-tos, projects and jobs from the portal's IT professionals.

Редакция КоммитРедакция портала
commit 56e5e37 · 15 days ago

🌐 Machine-translated from Russian. Show original

A brief overview of a task from the portal's life: how to send notifications about private messages so they arrive when needed and don't fall flat.

In this part:

What went wrong

The first version was simple: "if the recipient is not on the site — send it to Telegram, but no more than once every 10 minutes for dialogue." In practice:

  • An open background tab was considered "on the site" — the person left the computer, but there were no notifications.
  • The 10-minute window swallowed messages: the first arrived, the next five did not, and no one found out about them.

Idea: what matters is not "online," but "read"

We stopped guessing where the person was and started looking at the fact: was the message left unread?

  1. A message arrived → set a timer for 45 seconds (for push in the app — 8 seconds).
  2. The timer went off → we check in the database if it was read. Read on the website — we are silent.
  3. Not → one notification was read in the entire pack: from whom, how many, the last three messages.
  4. The next notification for the same dialog is no earlier than 3 minutes later and only for messages received after the previous one.

While the timer waits, new messages simply go into the same batch — the timer does not restart.

What to store

Read more
Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up