Skip to content

fix(calendar): support Safari 15 when limitDays is set - #4351

Draft
ashenthefox wants to merge 2 commits into
MagicMirrorOrg:developfrom
ashenthefox:fix/calendar-safari15-grouping
Draft

ashenthefox wants to merge 2 commits into
MagicMirrorOrg:developfrom
ashenthefox:fix/calendar-safari15-grouping

Conversation

@ashenthefox

@ashenthefox ashenthefox commented Nov 19, 2026 •

Copy link
Copy Markdown

Fixes #4350.

What changes

  • Replace the Object.groupBy() call in the calendar's limitDays > 0 code path with a simple date-keyed grouping loop compatible with Safari 15.
  • Keep the same event order and YYYY-MM-DD date keys. No global polyfill and no effect on the limitDays: 0 path.
  • Add five focused Vitest-discoverable regression tests that load the actual calendar.js module in a VM where Object.groupBy is undefined: empty/unlimited lists, two-day ordering, one-day boundary and maximum entries, already-finished events.

Actual validation

  • Baseline reproduction, Node 22.16.0, source-integrated test against upstream develop 86a2d722b72353222189c0d8af02104f4b9485f3: 2 passed, 3 failed, expected TypeError: Object.groupBy is not a function from real createEventList.
  • Patched source, same focused tests using a minimal Node runner for Vitest describe/it/expect globals: 5 passed, 0 failed, exit 0.
  • Syntax checks on changed source and test file passed. The tests execute the real Module.register('calendar', ...) implementation; a lightweight fake moment boundary supplies fixed dates to avoid external dependency installation and check exact date behavior.
  • The full repository node --run test, Prettier/ESLint, and Electron/browser suite have not been executed locally, because the repository's npm dependencies are not present and network installation is unavailable in this environment. CI status will be checked against the exact PR head. This PR remains draft until relevant checks or another authentic validation route establishes readiness.

No screenshots: this is a logic/compatibility correction without intended visual design changes.

Additional execution and exact-head CI

  • Chromium browser JS execution (Playwright): loading the actual original calendar module with Object.groupBy unavailable produces TypeError: Object.groupBy is not a function; loading the patched module under the same browser fixture yields the expected Today/Tomorrow list. This is a controlled module-level browser reproduction, not Safari 15 hardware testing and not an entire MagicMirror UI E2E test.
  • Rerun against committed source: node run_tests.mjs (local minimal Vitest-globals shim) 5 passed / 0 failed; node --check defaultmodules/calendar/calendar.js and node --input-type=module --check < tests/unit/modules/default/calendar/calendar_grouping_spec.js both exited 0. The latter parses the Vitest-import syntax as ESM; no claim of a native Vitest run.
  • Upstream CI bound to head bce194589d10ec89b874228e33a4c49dd66edaec: Review Dependencies (44560388748), CodeQL (44560388822), Electron Rebuild Testing (44560388555), Enforce Pull-Request Rules (44560388603), Run Automated Tests (44560388640) all show completed/action_required with zero jobs each. No workflow, linter, Electron suite or Playwright E2E can be counted as passed. Maintainer-side approval is required to start these upstream workflows. This draft stays unverified by CI pending that authorization.

Verified current CI and regression recheck (2026-11-20)

GitHub now reports 13 completed/successful head-bound check runs on 4006636c2cdcea6ee84b6fb6d77c21ddc658568c, including Node 22/24/26 test jobs, code-style checks, dependency review, CodeQL and Electron rebuilds. This supersedes the earlier action_required statuses recorded above for the older commit bce1945.

Independently reran the five committed calendar grouping regression cases using the source at the upstream base SHA and patched current PR source in Node 22.16.0 with a minimal Vitest API shim: upstream 2 passed / 3 failed (Object.groupBy is not a function, exit 1); patched 5 passed / 0 failed (exit 0). This is source-level validation, not a native local Vitest run, full UI E2E run or Safari 15 device test. CI results are GitHub-reported, not rerun locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant