Open khassel opened 2 months ago
Thanks. Will check this again later ...
sadly the errors still exist.
We had a problem with package-lock.json
, fix for this is on the way.
I tested with node-ical 19, and the problem is that the EXDATE entries are not returned in the parsed data I opened https://github.com/jens-maus/node-ical/issues/338 to document the problem.
all of the failing testcases have EXDATE entries
I think I have fix for that problem (they were returned but converted to UTC time so never will match)
BUT I think I have a fix for all the date conversion problems. (all our testcases pass with all the conversions commented out)
want more testing..
see this.. waiting on user test for submitting PR here and node-ical all testcases in both run successfully..
here is a test version of the fixes for all kinds of date problems.
best to make a new folder and git clone there
git clone https://github.com/sdetweil/MagicMirror
git checkout fixcaldates
npm run install-mm
copy your config.js and custom.css from the prior folder and the non-default modules you have installed..
this ONLY changes the default calendar but DOES ship an updated node-ical library too
if you need to fall back, just rename the folders around again so that your original is called MagicMirror
all the testcases for node-ical and MagicMirror execute successfully.
the 'BIG' change here is to get the local NON-TZ dates for the rrule.between()
all the checking and conversion code is commented out or not used the node-ical fixes are for excluded dates (exdate) values being adjusted for DST/STD time.. waiting to submit that PR
one fix in calendar.js for checking if a past date was too far back, but it never checked to see IF the event date was in the past.. (before today) so it chopped off too many
and one change in calendarfetcher.js to put out a better diagnostic message of the parsed data.. (exdate was excluded cause JSON stringify couldn't convert the complex structure)
added more testcases
anyone that wants to test still use my fork instructions above if you already downloaded my fork, please
fixed a bunch more testcases.. updated tests
both mm and node-ical changed
cd MagicMirror
git pull
rm -rf node_modules
npm run install-mm
I tested your branch and I still get some test errors:
FAIL unit tests/unit/modules/default/calendar/calendar_fetcher_utils_bad_rrule.js
Calendar fetcher utils test
filterEvents
✕ no events, not crash (53 ms)
● Calendar fetcher utils test › filterEvents › no events, not crash
expect(received).toHaveLength(expected)
Expected length: 0
Received length: 2
Received array: [{"class": undefined, "description": "ongoingEvent", "endDate": "1728689046900", "fullDayEvent": false, "geo": false, "location": false, "startDate": "1728681846899", "title": "ongoingEvent"}, {"class": undefined, "description": "upcomingEvent", "endDate": "1728692646900", "fullDayEvent": false, "geo": false, "location": false, "startDate": "1728689046900", "title": "upcomingEvent"}]
24 | );
25 |
> 26 | expect(filteredEvents).toHaveLength(0);
| ^
27 | });
28 | });
29 | });
at Object.toHaveLength (tests/unit/modules/default/calendar/calendar_fetcher_utils_bad_rrule.js:26:27)
FAIL electron tests/electron/modules/calendar_spec.js (56.808 s)
Calendar module
Test css classes
✓ has css class dayBeforeYesterday (2326 ms)
✓ has css class yesterday (2312 ms)
✓ has css class today (2258 ms)
✓ has css class tomorrow (2309 ms)
✓ has css class dayAfterTomorrow (2280 ms)
Events from multiple calendars
✓ should show multiple events with the same title and start time from different calendars (2270 ms)
rrule
✓ Issue #3393 recurrence dates past rrule until date (2340 ms)
Exdate: LA crossover DST before midnight GMT
✓ LA crossover DST before midnight GMT should have 2 events (2270 ms)
Exdate: LA crossover DST at midnight GMT local STD
✓ LA crossover DST before midnight GMT should have 2 events (2330 ms)
Exdate: LA crossover DST at midnight GMT local DST
✓ LA crossover DST before midnight GMT should have 2 events (2330 ms)
Exdate: SYD crossover DST before midnight GMT
✓ LA crossover DST before midnight GMT should have 2 events (2250 ms)
Exdate: SYD crossover DST at midnight GMT local STD
✓ LA crossover DST before midnight GMT should have 2 events (2289 ms)
Exdate: SYD crossover DST at midnight GMT local DST
✓ SYD crossover DST at midnight GMT local DST should have 2 events (2309 ms)
sliceMultiDayEvents
✓ Issue #3452 split multiday in Europe (2269 ms)
germany timezone
✓ Issue #unknown fullday timezone East of UTC edge (2249 ms)
germany all day repeating moved (recurrence and exdate)
✓ Issue #unknown fullday timezone East of UTC event moved (2270 ms)
chicago late in timezone
✕ Issue #unknown rrule US close to timezone edge (20071 ms)
● Calendar module › chicago late in timezone › Issue #unknown rrule US close to timezone edge
thrown: "Exceeded timeout of 20000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
166 |
167 | describe("chicago late in timezone", () => {
> 168 | it("Issue #unknown rrule US close to timezone edge", async () => {
| ^
169 | await helpers.startApplication("tests/configs/modules/calendar/chicago_late_in_timezone.js", "01 Sept 2024 10:38:00 GMT-06:00", ["js/electron.js"], "Europe/Berlin");
170 | await expect(doTestTableContent(".calendar .event", ".time", "10th.Sep, 20:15")).resolves.toBe(true);
171 | });
at it (tests/electron/modules/calendar_spec.js:168:3)
at describe (tests/electron/modules/calendar_spec.js:167:2)
at Object.describe (tests/electron/modules/calendar_spec.js:3:1)
FAIL e2e tests/e2e/modules/calendar_spec.js (58.988 s)
Calendar module
Default configuration
✓ should show the default maximumEntries of 10 (1302 ms)
✓ should show the default calendar symbol in each event (201 ms)
Custom configuration
✓ should show the custom maximumEntries of 5 (1204 ms)
✓ should show the custom calendar symbol in four events (201 ms)
✓ should show a customEvent calendar symbol in one event (202 ms)
✓ should show a customEvent calendar eventClass in one event (201 ms)
✓ should show two custom icons for repeating events (202 ms)
✓ should show two custom icons for day events (202 ms)
Recurring event
✓ should show the recurring birthday event 6 times (1306 ms)
FullDayEvent over several days should show how many days are left from the from the starting date on
✕ should contain text 'Ends in' with the left days (1212 ms)
✕ should contain in total three events (204 ms)
FullDayEvent Single day, should show Today
✓ should contain text 'Today' (1202 ms)
✕ should contain in total two events (203 ms)
Recurring event per timezone
✓ should contain text "Mar 25th" in timezone UTC 12 (1203 ms)
✓ should contain text "Mar 25th" in timezone UTC 11 (1206 ms)
✓ should contain text "Mar 25th" in timezone UTC 10 (1205 ms)
✓ should contain text "Mar 25th" in timezone UTC 9 (1313 ms)
✓ should contain text "Mar 25th" in timezone UTC 8 (1203 ms)
✓ should contain text "Mar 25th" in timezone UTC 7 (1216 ms)
✓ should contain text "Mar 25th" in timezone UTC 6 (1207 ms)
✓ should contain text "Mar 25th" in timezone UTC 5 (1207 ms)
✓ should contain text "Mar 25th" in timezone UTC 4 (1203 ms)
✓ should contain text "Mar 25th" in timezone UTC 3 (1207 ms)
✓ should contain text "Mar 25th" in timezone UTC 2 (1314 ms)
✓ should contain text "Mar 25th" in timezone UTC 1 (1204 ms)
✓ should contain text "Mar 25th" in timezone UTC 0 (1251 ms)
✓ should contain text "Mar 25th" in timezone UTC -1 (1202 ms)
✓ should contain text "Mar 25th" in timezone UTC -2 (1205 ms)
✓ should contain text "Mar 25th" in timezone UTC -3 (1223 ms)
✓ should contain text "Mar 25th" in timezone UTC -4 (1212 ms)
✓ should contain text "Mar 25th" in timezone UTC -5 (1320 ms)
✓ should contain text "Mar 25th" in timezone UTC -6 (1208 ms)
✓ should contain text "Mar 25th" in timezone UTC -7 (1219 ms)
✓ should contain text "Mar 25th" in timezone UTC -8 (1210 ms)
✓ should contain text "Mar 25th" in timezone UTC -9 (1206 ms)
✓ should contain text "Mar 25th" in timezone UTC -10 (1413 ms)
✓ should contain text "Mar 25th" in timezone UTC -11 (1209 ms)
Changed port
✓ should return TestEvents (1313 ms)
Basic auth
✓ should return TestEvents (1212 ms)
Basic auth by default
✓ should return TestEvents (1428 ms)
Basic auth backward compatibility configuration: DEPRECATED
✓ should return TestEvents (1217 ms)
Fail Basic auth
✓ should show Unauthorized error (1221 ms)
● Calendar module › FullDayEvent over several days should show how many days are left from the from the starting date on › should contain text 'Ends in' with the left days
expect(received).resolves.toBe()
Received promise rejected instead of resolved
Rejected to value: [Error: expect(received).toContain(expected) // indexOf·
Expected substring: "Ends in"
Received string: "Today"]
97 |
98 | it("should contain text 'Ends in' with the left days", async () => {
> 99 | await expect(testTextContain(".calendar .today .time", "Ends in")).resolves.toBe(true);
| ^
100 | await expect(testTextContain(".calendar .yesterday .time", "Today")).resolves.toBe(true);
101 | await expect(testTextContain(".calendar .tomorrow .time", "Tomorrow")).resolves.toBe(true);
102 | });
at expect (node_modules/expect/build/index.js:113:15)
at Object.expect (tests/e2e/modules/calendar_spec.js:99:10)
● Calendar module › FullDayEvent over several days should show how many days are left from the from the starting date on › should contain in total three events
expect(received).resolves.toBe()
Received promise rejected instead of resolved
Rejected to value: [Error: expect(received).toHaveLength(expected)·
Expected length: 3
Received length: 4
Received object: [<tr class="event-wrapper normal event yesterday"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Ends in a day</td></tr>, <tr class="event-wrapper normal event today" style="opacity: 1;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Today</td></tr>, <tr class="event-wrapper normal event tomorrow" style="opacity: 0.6666666666666667;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Tomorrow</td></tr>, <tr class="event-wrapper normal event dayAfterTomorrow" style="opacity: 0.33333333333333337;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Monday</td></tr>]]
102 | });
103 | it("should contain in total three events", async () => {
> 104 | await expect(testElementLength(".calendar .event", 3)).resolves.toBe(true);
| ^
105 | });
106 | });
107 |
at expect (node_modules/expect/build/index.js:113:15)
at Object.expect (tests/e2e/modules/calendar_spec.js:104:10)
● Calendar module › FullDayEvent Single day, should show Today › should contain in total two events
expect(received).resolves.toBe()
Received promise rejected instead of resolved
Rejected to value: [Error: expect(received).toHaveLength(expected)·
Expected length: 2
Received length: 4
Received object: [<tr class="event-wrapper normal event yesterday"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Today</td></tr>, <tr class="event-wrapper normal event today" style="opacity: 1;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Today</td></tr>, <tr class="event-wrapper normal event tomorrow" style="opacity: 0.6666666666666667;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Tomorrow</td></tr>, <tr class="event-wrapper normal event dayAfterTomorrow" style="opacity: 0.33333333333333337;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Monday</td></tr>]]
116 | });
117 | it("should contain in total two events", async () => {
> 118 | await expect(testElementLength(".calendar .event", 2)).resolves.toBe(true);
| ^
119 | });
120 | });
121 |
at expect (node_modules/expect/build/index.js:113:15)
at Object.expect (tests/e2e/modules/calendar_spec.js:118:10)
that the electron tests, right? I didnt run e2e
you DID npm install to get the updated node-ical, right? I have a short term github link to my fork of that
i'll go over the e2e tests.. only ran electron due to the date constraints thanks
these tests errored:
tests/unit/modules/default/calendar/calendar_fetcher_utils_bad_rrule.js
tests/electron/modules/calendar_spec.js
tests/e2e/modules/calendar_spec.js
you DID npm install to get the updated node-ical, right?
sure, used this:
services:
magicmirror:
image: registry.gitlab.com/khassel/magicmirror:develop_debug22
ports:
- "8080:8080"
stdin_open: true
tty: true
command:
- /bin/bash
- -c
- |
# comment out if needed:
rm -rf ./*
rm -rf ./.*
git clone -b fixcaldates https://github.com/sdetweil/MagicMirror.git .
npm install
mv config/config.js.sample config/config.js
sed -i 's|address:.*|address: "0.0.0.0",|g;s|ipWhitelist:.*|ipWhitelist: [],|g' config/config.js
touch ${MM_CUSTOMCSS_FILE:-"css/custom.css"}
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99
/bin/bash
thx..
new branch
here is an updated test version of the fixes for all kinds of calendar date problems.
NOTE: the changed branch name NOTE: this used the node-cal@0.19.0 library UNCHANGED
best to make a new folder and git clone there
git clone https://github.com/sdetweil/MagicMirror cd MagicMirror git checkout fixcaldates2 // <------ note this is a changed branch name npm run install-mm copy your config.js and custom.css from the prior folder and the non-default modules you have installed…
this ONLY changes the default calendar but DOES ship an updated node-ical library too
if you need to fall back, just rename the folders around again so that your original is called MagicMirror
all the testcases for node-ical and MagicMirror execute successfully.
the ‘BIG’ change here is to get the local NON-TZ dates for the rrule.between()
all the checking and conversion code is commented out or not used the node-ical fixes are for excluded dates (exdate) values being adjusted for DST/STD time… waiting to submit that PR
one fix in calendar.js for checking if a past date was too far back, but it never checked to see IF the event date was in the past… (before today) so it chopped off too many
and one change in calendarfetcher.js to put out a better diagnostic message of the parsed data… (exdate was excluded cause JSON stringify couldn’t convert the complex structure)
I added the tests you all have documented
please re-pull and checkout the new branch (I deleted the old branch) and npm run install-mm again
node-ical version 0.20. posted to npm
will update pr next week when back home
electron tests:
e2e tests: