Regression: preserve message order when scheduled to the same time#374
Regression: preserve message order when scheduled to the same time#374dazewell wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR modifies ChangesSchedule Timestamp Precision
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR changes the target minute for relative scheduling, while the reported issue is ordering within the same scheduled minute. Those are different behaviors, so the fix does not match the repro. |
Repro
Expected
Message "1" is first.
Message "2" is second.
Actual
Message "2" is first.
Message "1" is second.
Official Telegram behavior
Message "1" is first.
Message "2" is second.
Why
This happens because of the recently added rounding to the closest minute when scheduling a message. Official Telegram is not doing that so if Message "1" is scheduled at 10:00:01 for 12:34, and if Message "2" is scheduled at 10:00:08 for 12:34, then they save their "seconds" component under the hood and this helps to preserve the relative order of the messages upon scheduling.
Rounding, instead, reverses the order and at some point start injecting messages around other messages (if the current clock second is >30 or not).