-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RAM] Snooze end time shows 1 day ahead of actual end time #152630
Comments
Pinging @elastic/response-ops (Team:ResponseOps) |
Just started investigating but this is probably related to the fact that this rule is supposed to start on Friday February 24th and recur every Saturday. It’s checking for the end of the “last occurrence” when a new occurrence begins one hour after the snooze is supposed to start. We’ve got two overlapping occurrences. |
Yeah so shifting the start time forward by an hour makes this pass successfully. Seems like there's an issue related to time zones not taking days of the week into account correctly, I'll work on a fix. |
Test also fails if we set the date to March 6th UTC. It looks like RRule isn't converting According to jkbrzt/rrule#501 this may actually be the correct behavior, as per the spec? But the library doesn't follow the spec? I'm not sure. Seems like the library is actually following the spec as far as weekdays are concerned |
Okay so I have found out what's happening. rrule.js does not respect the I think this is actually RRule spec compliant, it's just super weird in Javascript. We basically need to treat the |
## Summary Resolves: #152630 For maintenance windows, I noticed I was getting inconsistent unit test results depending on the timezone of the computer that is running the tests. To fix this I normalized the inputs going into RRule. I realized I could apply this to the snooze bug, and lo and behold this change seem to get us consistent results for the snooze tests and fixes the timezone issue we had. This works as a temporary fix for the snooze bug and making maintenance window test consistent across different CI regions, however we will want to migrate to our own RRule library (#152873) once we can test it more. ## Tested in the following timezones: ``` // in jest.config.ts // // process.env.TZ = 'America/Los_Angeles' // process.env.TZ = 'America/Denver' // process.env.TZ = 'America/New_York' // process.env.TZ = 'UTC' // process.env.TZ = 'Europe/London' // process.env.TZ = 'Europe/Madrid' // process.env.TZ = 'Asia/Calcutta' // process.env.TZ = 'Asia/Tokyo' ``` --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…pliant lib (#152873) ## Summary Closes #152630 ~Adds a fix for the weird UTC-but-not-really expected inputs in rrule.js~ This PR removes the third-party `rrule` package and replaces it with `@kbn/rrule`. The third party RRule library's functions produced different results depending on what system timezone you ran it in. It would output local timestamps in UTC, making it impossible to do reliable math on them. It's now replaced with our own library that passes all of our own tests for the limited cross-section of the RRule spec that we need to support. It's possible that it wouldn't stand up to the rigor of more complex RRule queries, but it supports the ones that our Recurrence Scheduler UI supports just fine. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
From the SDH: https://github.com/elastic/sdh-kibana/issues/3588
A user noticed their snooze end time is 1 day after the actual end time. The user is in the
CET
timezone, which isGMT+1
I am able to reproduce this issue using a unit test. In the test below I have simulated the date that was reported in the SDH:I looked in our snooze code and I think the
before
call fromis_snooze_active line 43
is giving us the wrong result:The text was updated successfully, but these errors were encountered: