From 730f2eb0b8af2efb6c91aa956a79e7c5a9975bad Mon Sep 17 00:00:00 2001 From: veeck Date: Sun, 17 Oct 2021 16:01:01 +0200 Subject: [PATCH 1/7] Add fix for chaotic newsfeed display after network connection loss --- CHANGELOG.md | 1 + modules/default/newsfeed/newsfeed.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b112cb2a..49fd5688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed wrong file `kr.json` to `ko.json`. Use language code 'ko' instead of 'kr' for Korean language. - Fixed `feels_like` data from openweathermaps current weather being ignored (#2678). +- Fixed chaotic newsfeed display after network connection loss (#2638). ## [2.17.1] - 2021-10-01 diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 7e21f8a8..b5113675 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -295,6 +295,9 @@ Module.register("newsfeed", { this.sendNotification("NEWS_FEED", { items: this.newsItems }); } + // #2638 Clear timer if it already exists + if (this.timer) clearInterval(this.timer); + this.timer = setInterval(() => { this.activeItem++; this.updateDom(this.config.animationSpeed); From 8ee73a11bb8b5e716d2384a1f85ea902fe89a7f0 Mon Sep 17 00:00:00 2001 From: Veeck Date: Sun, 17 Oct 2021 18:39:06 +0200 Subject: [PATCH 2/7] Update CHANGELOG add credits where credits due :-) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c94db1c..fd6f5199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed wrong file `kr.json` to `ko.json`. Use language code 'ko' instead of 'kr' for Korean language. - Fixed `feels_like` data from openweathermaps current weather being ignored (#2678). -- Fixed chaotic newsfeed display after network connection loss (#2638). +- Fixed chaotic newsfeed display after network connection loss thanks to @jalibu (#2638). ## [2.17.1] - 2021-10-01 From 90deaf564fc96761c1fa90c246760f520dbc3496 Mon Sep 17 00:00:00 2001 From: veeck Date: Sun, 17 Oct 2021 18:56:18 +0200 Subject: [PATCH 3/7] Update codecov action before the old one gets deprecated --- .github/workflows/codecov-test-suites.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov-test-suites.yml b/.github/workflows/codecov-test-suites.yml index 8c2be8da..d080a18b 100644 --- a/.github/workflows/codecov-test-suites.yml +++ b/.github/workflows/codecov-test-suites.yml @@ -23,7 +23,7 @@ jobs: touch css/custom.css npm run test:coverage - name: Upload coverage results to codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2 with: - file: ./coverage/lcov.info + files: ./coverage/lcov.info fail_ci_if_error: true From c623ca9fe0ac1c4a64e7f7ab4b09fd7f47a75a03 Mon Sep 17 00:00:00 2001 From: veeck Date: Sun, 17 Oct 2021 18:56:48 +0200 Subject: [PATCH 4/7] Update other actions and dependencies --- .github/workflows/automated-tests.yml | 3 ++- .github/workflows/enforce-changelog.yml | 2 +- package-lock.json | 28 ++++++++++++------------- package.json | 4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index 9e1047b3..79888154 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -20,9 +20,10 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + cache: "npm" - name: Install dependencies and run tests run: | Xvfb :99 -screen 0 1024x768x16 & diff --git a/.github/workflows/enforce-changelog.yml b/.github/workflows/enforce-changelog.yml index e1c2856d..07732cd7 100644 --- a/.github/workflows/enforce-changelog.yml +++ b/.github/workflows/enforce-changelog.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Enforce changelog️ - uses: dangoslen/changelog-enforcer@v1.6.1 + uses: dangoslen/changelog-enforcer@v2 with: changeLogPath: "CHANGELOG.md" skipLabels: "Skip Changelog" diff --git a/package-lock.json b/package-lock.json index bd107f88..d7cc1527 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,11 +23,11 @@ "moment": "^2.29.1", "node-fetch": "^2.6.5", "node-ical": "^0.13.0", - "socket.io": "^4.3.0" + "socket.io": "^4.3.1" }, "devDependencies": { "eslint-config-prettier": "^8.3.0", - "eslint-plugin-jest": "^25.2.1", + "eslint-plugin-jest": "^25.2.2", "eslint-plugin-jsdoc": "^36.1.1", "eslint-plugin-prettier": "^4.0.0", "express-basic-auth": "^1.2.0", @@ -3553,9 +3553,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "25.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-25.2.1.tgz", - "integrity": "sha512-fC6T95lqgWHsdVFd+f0kTHH32NxbIzIm1fJ/3kGaCFcQP1fJc5khV7DzUHjNQSTOHd5Toa7ccEBptab4uFqbNQ==", + "version": "25.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-25.2.2.tgz", + "integrity": "sha512-frn5yhOF60U4kcqozO3zKTNZQUk+mfx037XOy2iiYL8FhorEkuCuL3/flzKcY1ECDP2WYT9ydmvlO3fRW9o4mg==", "dev": true, "dependencies": { "@typescript-eslint/experimental-utils": "^5.0.0" @@ -8828,9 +8828,9 @@ } }, "node_modules/socket.io": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.0.tgz", - "integrity": "sha512-15eJ4fLho1uQTgdvAKlkMPvhvurky8KAc0F+wAdrSoIk+rKEYor8vPKiV5grp4J0sQpPms/AW7w9BV6b/HB0oA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.1.tgz", + "integrity": "sha512-HC5w5Olv2XZ0XJ4gOLGzzHEuOCfj3G0SmoW3jLHYYh34EVsIr3EkW9h6kgfW+K3TFEcmYy8JcPWe//KUkBp5jA==", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", @@ -13359,9 +13359,9 @@ "requires": {} }, "eslint-plugin-jest": { - "version": "25.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-25.2.1.tgz", - "integrity": "sha512-fC6T95lqgWHsdVFd+f0kTHH32NxbIzIm1fJ/3kGaCFcQP1fJc5khV7DzUHjNQSTOHd5Toa7ccEBptab4uFqbNQ==", + "version": "25.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-25.2.2.tgz", + "integrity": "sha512-frn5yhOF60U4kcqozO3zKTNZQUk+mfx037XOy2iiYL8FhorEkuCuL3/flzKcY1ECDP2WYT9ydmvlO3fRW9o4mg==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "^5.0.0" @@ -17380,9 +17380,9 @@ } }, "socket.io": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.0.tgz", - "integrity": "sha512-15eJ4fLho1uQTgdvAKlkMPvhvurky8KAc0F+wAdrSoIk+rKEYor8vPKiV5grp4J0sQpPms/AW7w9BV6b/HB0oA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.1.tgz", + "integrity": "sha512-HC5w5Olv2XZ0XJ4gOLGzzHEuOCfj3G0SmoW3jLHYYh34EVsIr3EkW9h6kgfW+K3TFEcmYy8JcPWe//KUkBp5jA==", "requires": { "accepts": "~1.3.4", "base64id": "~2.0.0", diff --git a/package.json b/package.json index 5aca50e9..46e59933 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "homepage": "https://magicmirror.builders", "devDependencies": { "eslint-config-prettier": "^8.3.0", - "eslint-plugin-jest": "^25.2.1", + "eslint-plugin-jest": "^25.2.2", "eslint-plugin-jsdoc": "^36.1.1", "eslint-plugin-prettier": "^4.0.0", "express-basic-auth": "^1.2.0", @@ -83,7 +83,7 @@ "moment": "^2.29.1", "node-fetch": "^2.6.5", "node-ical": "^0.13.0", - "socket.io": "^4.3.0" + "socket.io": "^4.3.1" }, "_moduleAliases": { "node_helper": "js/node_helper.js", From 6508ec2d1774a80df49b640511629cc2451c6646 Mon Sep 17 00:00:00 2001 From: veeck Date: Sun, 17 Oct 2021 19:09:43 +0200 Subject: [PATCH 5/7] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd6f5199..ce3be820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ _This release is scheduled to be released on 2022-01-01._ - Update missed translations for Korean language (ko.json) - Cleaned up `alert` module and switched to nunjuck template. - Moved weather tests from category `electron` to `e2e`. +- Updated github actions. ### Fixed From 31d31fc3d3b1226d394c7ee5d2df5069bc8d254e Mon Sep 17 00:00:00 2001 From: Julian Dinter Date: Wed, 20 Oct 2021 15:05:40 +0200 Subject: [PATCH 6/7] [Fix] Fixed time zone calculation error on starting date of events with different time zones. --- modules/default/calendar/calendarutils.js | 28 +++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/modules/default/calendar/calendarutils.js b/modules/default/calendar/calendarutils.js index 91679f13..9d7e8d8f 100644 --- a/modules/default/calendar/calendarutils.js +++ b/modules/default/calendar/calendarutils.js @@ -160,7 +160,7 @@ const CalendarUtils = { } if (event.type === "VEVENT") { - Log.debug("\nEvent: " + JSON.stringify(event)); + Log.debug("Event:\n" + JSON.stringify(event)); let startDate = eventDate(event, "start"); let endDate; @@ -177,8 +177,8 @@ const CalendarUtils = { } } - Log.debug("startDate (local): " + startDate.toDate()); - Log.debug("endDate (local): " + endDate.toDate()); + Log.debug("start: " + startDate.toDate()); + Log.debug("end:: " + endDate.toDate()); // Calculate the duration of the event for use with recurring events. let duration = parseInt(endDate.format("x")) - parseInt(startDate.format("x")); @@ -332,17 +332,15 @@ const CalendarUtils = { Log.debug("Fullday"); // If the offset is negative (east of GMT), where the problem is if (dateoffset < 0) { - // Remove the offset, independently of the comparison between the date hour and the offset, - // since in the case that *date houre < offset*, the *new Date* command will handle this by - // representing the day before. - - // Reduce the time by the offset: - // Apply the correction to the date/time to get it UTC relative - date = new Date(date.getTime() - Math.abs(nowOffset) * 60000); - // the duration was calculated way back at the top before we could correct the start time.. - // fix it for this event entry - //duration = 24 * 60 * 60 * 1000; - Log.debug("new recurring date1 is " + date); + if (dh <= Math.abs(dateoffset / 60)) { + // reduce the time by the offset + // Apply the correction to the date/time to get it UTC relative + date = new Date(date.getTime() - Math.abs(dateoffset) * 60000); + // the duration was calculated way back at the top before we could correct the start time.. + // fix it for this event entry + //duration = 24 * 60 * 60 * 1000; + Log.debug("new recurring date1 is " + date); + } } else { // if the timezones are the same, correct date if needed if (event.start.tz === moment.tz.guess()) { @@ -387,7 +385,7 @@ const CalendarUtils = { } } startDate = moment(date); - Log.debug("Corrected startDate (local): " + startDate.toDate()); + Log.debug("Corrected startDate: " + startDate.toDate()); let adjustDays = CalendarUtils.calculateTimezoneAdjustment(event, date); From 47775381030efd09ef97d13d569576843f70ddca Mon Sep 17 00:00:00 2001 From: Julian Dinter Date: Wed, 20 Oct 2021 15:11:41 +0200 Subject: [PATCH 7/7] Updated CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce3be820..c3279fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed wrong file `kr.json` to `ko.json`. Use language code 'ko' instead of 'kr' for Korean language. - Fixed `feels_like` data from openweathermaps current weather being ignored (#2678). - Fixed chaotic newsfeed display after network connection loss thanks to @jalibu (#2638). +- Fixed incorrect time zone correction of recurring full day events (#2632 and #2634). ## [2.17.1] - 2021-10-01