-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix issue #3250: Respect deleted (excluded) calendar events #3251
Conversation
Thx for the PR. COuld you also write a test for this? |
@rejas After much ado, the unit test is added. I verified locally that it failed without the fix commit. Also needed to fix up .prettierignore since it seems like no one has added any .ics files since the switch to using prettier (git commit hook was failing) |
True, the ics should be added to prettierignore, good catch. But why add the ignore files too? |
Oddly enough, .prettierignore didn't ignore itself, so Prettier complained that it couldn't find a linter for .prettierignore. Originally I had also made some changes to .eslintignore as well, but ended up not needing them. The same issue will exist the next time it is changed though. Basically we're going to have an issue with any file type that Prettier doesn't understand as soon as someone tries to commit that type. |
@rejas Do I need to do anything with the failing tests? It looks like they're running current tests on old versions of MM which would of course break as they don't have the fix |
No, the tests should be running on the PR you made, so are you sure they are running fine on our local machine? |
@rejas yep, here's the final output from me running
|
What node version did you use when running the tests? |
|
when running the e2e tests on your branch I'm getting this error: Summary of all failing tests
FAIL tests/e2e/modules/calendar_spec.js (65.054 s)
● Calendar module › exdate check › should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period
expect(received).toBe(expected) // Object.is equality
Expected: 51
Received: 52
14 | expect(elem.length).not.toBe(result);
15 | } else {
> 16 | expect(elem.length).toBe(result);
| ^
17 | }
18 | };
19 |
at toBe (tests/e2e/modules/calendar_spec.js:16:24)
at Object.<anonymous> (tests/e2e/modules/calendar_spec.js:94:4)
Test Suites: 1 failed, 21 passed, 22 total
Tests: 1 failed, 429 passed, 430 total
Snapshots: 0 total
Time: 136.612 s
Ran all test suites. node@5cd4b2fb6e3b:/opt/magic_mirror$ git remote -v
origin https://github.com/jkriegshauser/MagicMirror.git (fetch)
origin https://github.com/jkriegshauser/MagicMirror.git (push)
node@5cd4b2fb6e3b:/opt/magic_mirror$ git status
On branch issue-3250-fix
Your branch is up to date with 'origin/issue-3250-fix'.
nothing to commit, working tree clean
node@5cd4b2fb6e3b:/opt/magic_mirror$ node -v
v20.8.1 same result with node v21.0.0 |
@khassel thanks for testing. What timezone are you in? I suspect it has something to do with different tz. |
node@0d036a3068da:/opt/magic_mirror$ echo $TZ
Europe/Berlin
node@0d036a3068da:/opt/magic_mirror$ date
Sat Oct 28 22:34:25 CEST 2023 |
Confirmed that it fails for me if I run:
I suspect it will work for you if you run:
I'll debug it later. I believe that there is a bug deep within |
rrule is a mess... it expects ONLY local date/time.. no timezone. |
works. If there is no better solution we could create the used ics file on the fly with current timezone (or replace it in the file before testing) |
Can someone kick off the workflows to see if tests pass? |
done, they fail but this seems unrelated to your changes, your test passed. I don't think this is a solution because the tests should not depend on a timezone (e.g. we don't know in which timezone the github job will run when doing the tests and everyone should be able to run the tests without setting a timezone ...) |
Looks like the new
|
In general I agree with this sentiment. I think the underlying problem is in the
In other words, there's already some hackery around trying to correct the date because the underlying recurrence rule calculation is faulty, which seems to be coming from |
I'll try to investigate this over the next few days. The next release is 2024, so we have some time. I think we've had similar issues with other tests, but I'll have to search to find this ... and in my time zone it's too late for that now ;) |
rrule is not the tool to use but it's the one behing used rrule depends on local date and time not tz based datetime. but node-ical parses the ICS into tz based dates and times.. BUT WE DONT KNOW because we never process the ICS ourselves. I have spent a few months looking at this problem with an issue open on node-ical. but I cannot find a reliable fix |
you closed this @sdetweil ? |
sorry, errant finger check |
I did some tests and changing the content of the ics-file from I looped over different timezones and the test always passed 'Pacific/Niue',
'Pacific/Rarotonga',
'Pacific/Marquesas',
'Pacific/Gambier',
'America/Juneau',
'America/Creston',
'America/Belize',
'America/Eirunepe',
'America/Antigua',
'Antarctica/Palmer',
'America/St_Johns',
'America/Noronha',
'Atlantic/Cape_Verde',
'Antarctica/Troll',
'Europe/Berlin',
'Africa/Gaborone',
'Antarctica/Syowa',
'Asia/Tehran',
'America/Anguilla',
'Asia/Kabul',
'Antarctica/Mawson',
'Asia/Colombo',
'Asia/Kathmandu',
'Antarctica/Vostok',
'Indian/Cocos',
'Antarctica/Davis',
'Australia/Perth',
'Australia/Eucla',
'Australia/Darwin',
'Antarctica/DumontDUrville',
'Australia/Adelaide',
'Pacific/Pago_Pago',
'Pacific/Fiji',
'Antarctica/McMurdo',
'Pacific/Chatham',
'Pacific/Kiritimati', so can you please change this again in your PR and merge new |
ed1477a
to
32f38e6
Compare
32f38e6
to
a48eadb
Compare
@khassel thanks for investigating. Done and done. |
@rejas from my side this can be merged now |
Hello and thank you for wanting to contribute to the MagicMirror² project
Please make sure that you have followed these 4 rules before submitting your Pull Request:
Note: Sometimes the development moves very fast. It is highly
recommended that you update your branch of
develop
before creating apull request to send us your changes. This makes everyone's lives
easier (including yours) and helps us out on the development team.
Thanks again and have a nice day!