Skip to content

test(calendar): pin the timezone-change test to a past week - #990

Closed
neurekadev wants to merge 1 commit into
Silo-Server:mainfrom
neurekadev:fix/989-calendar-test-past-week
Closed

neurekadev wants to merge 1 commit into
Silo-Server:mainfrom
neurekadev:fix/989-calendar-test-past-week

Conversation

@neurekadev

@neurekadev neurekadev commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #989
Related issue: N/A (first seen on #988's Apple regression run)
Validation tasks: none

CalendarTimeZoneTests.testLoadAfterATimeZoneChangeRequestsTheSameWeekInTheNewZone fails on the Silo and SiloTV simulator suites for any branch whose CI runs from 2 to 8 November 2026. The test hard-codes that week. After a timezone change, CalendarViewModel selects today when today falls inside the shown week, so the last assertion (selectedDay == week.startDate) fails this week only. This blocks every open PR's Apple regression run until 9 November, including #988.

Approach

The test moves to the week of 3 to 9 November 2025, which is in the past and never contains today. It still checks the same thing: Monday 3 November in Auckland is still Sunday 2 November in Los Angeles, and the request keeps the same Monday-to-Sunday dates after the timezone change. Only the test changes; CalendarViewModel behaves as intended.

Validation

  • Dates checked with Python's zoneinfo: 5 November 2025 is a Wednesday. Auckland's Monday at midnight is Sunday 03:00 in Los Angeles. The rebuilt week's Thursday anchor (Monday plus 3.5 days) is Wednesday 5 November in Los Angeles, so the week stays 3 to 9 November.
  • Build and tests: not run locally (the author has no Mac). This PR's Apple regression CI runs the suite.

Evidence

Evidence: none, no user-visible change

Risks

None identified. Test-only change.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, not yet human verified. The agent found the failure in fix(tvos): return to the last focused hero action when moving up #988's CI and traced it to the test.
  • Adversarial review: one reviewer agent checked 0480748..0881696: the expected dates, DST in both zones that week, rebuilt(in:) anchoring, and whether the test still catches a cross-day regression. No findings.

🤖 Generated with Claude Code

The test hard-coded the week of 2 to 8 November 2026. While that week is
the current one, a timezone change selects today instead of the week's
Monday, so the test failed on every branch. A past week never contains
today.

Closes Silo-Server#989

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 3, 2026
@silo-kody

silo-kody Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T01:01:41.133063Z 0881696 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The timezone-change test now uses a fixed week in November 2025 and updates its expected request dates to November 3–9. Comments explain the weekday difference between Auckland and Los Angeles and the choice of a past week. The expected timezone sequence is unchanged.

Changes: Calendar timezone test

Layer / File(s) Summary
Test week and expected request dates
iosApp/Tests/CalendarTimeZoneTests.swift
The test now initializes its week from November 5, 2025, and expects request dates from November 3 through November 9. Comments explain the timezone weekday difference and use of a past week. The expected timezone sequence is unchanged.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other · Severity of issue fixed: Medium

Possibly related issues

  • #989 — The issue reports this test failing when its hard-coded week is current. The change moves the test to a past week, addressing the reported cause.

Suggested labels: size/S

Suggested reviewers: timmyconnect

Merge Risk: Minimal · up to 08816

No actionable merge-blocking risk was identified in this test-only change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: pinning the calendar timezone-change test to a past week.
Linked Issues check Passed Issue #989 requires this timezone-change test to avoid a failure caused by selecting today when the fixed week contains today. The change moves the fixture to 3–9 November 2025, updates the expected r…
Out of Scope Changes check Passed The whole pull request changes only iosApp/Tests/CalendarTimeZoneTests.swift. The added comments and updated test dates directly support issue #989. No unrelated product or test changes are present.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Description check Passed The description is directly related to the changeset. It names the failing test (CalendarTimeZoneTests.testLoadAfterATimeZoneChangeRequestsTheSameWeekInTheNewZone), explains why it fails (the hard-cod…
Full details: Linked Issues check

Explanation

Issue #989 requires this timezone-change test to avoid a failure caused by selecting today when the fixed week contains today. The change moves the fixture to 3–9 November 2025, updates the expected request dates, and preserves the Auckland-to-Los-Angeles timezone sequence and Monday selection assertions. This implements the issue's proposed date-independent test correction.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The description is directly related to the changeset. It names the failing test (CalendarTimeZoneTests.testLoadAfterATimeZoneChangeRequestsTheSameWeekInTheNewZone), explains why it fails (the hard-coded 2-8 November 2026 week contains the current date), and describes the fix (moving the test to the 3-9 November 2025 week). It also covers validation, the AI disclosure, and the test-only scope, so it is specific and not generic.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/kotlin/security/sql-injection-rawquery-concat-kotlin.yml

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: baef1ccf-98e0-4bb8-9375-9c5640b8f569
Commits

Reviewing files that changed from the base of the PR and between 0480748 and 0881696.

Files selected for processing: 1
  • iosApp/Tests/CalendarTimeZoneTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@silo-triage silo-triage Bot added bug Something isn't working priority: P2 Limited scope, workaround exists, or polish labels Nov 3, 2026
@neurekadev

Copy link
Copy Markdown
Contributor Author

Adversarial Review

  • Model: Claude Opus 5.5
  • Harness: Claude Code

Reviewed 0480748..0881696: no findings.

@Quick104

Quick104 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing: #1005 already fixed this test on main. It pins the view model's clock instead of moving the week into the past, and adds coverage for a timezone change during the current week. Thanks for tracking this down.

@Quick104 Quick104 closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] CalendarTimeZoneTests fails while its hard-coded week is the current week

2 participants