Skip to content

Fix stale timetable: follow the renamed grid variables in the Comcigan viewer - #81

Merged
lmwmason merged 1 commit into
mainfrom
fix/comcigan-renderer-vars
Nov 26, 2026
Merged

lmwmason merged 1 commit into
mainfrom
fix/comcigan-renderer-vars

Conversation

@lmwmason

Copy link
Copy Markdown
Contributor

Problem

The timetable shows the last good copy again (refresh failing since 2026-11-26 ~11:10 KST). Production log: Timetable refresh unavailable; last-good fallback checked every few minutes.

Cause

Step-by-step probe against the live provider: six of the seven extractors pass; only extractComciganFields fails. The viewer no longer assigns 원자료=Q자료(자료.X[…]) / 일일자료=…; each cell now reads into arbitrarily named variables (E6WU=Cak7(자료.NMZ366[…]);eXF6=Cak7(자료.ODS294[…])) and calls baSplit(eXF6,E6WU,…). From baSplit's body, the first argument is the current (daily) value and the second the original (a difference is rendered as "변경").

Fix

extractComciganFields keeps the old patterns first. If base/daily are not found, it maps variable → field from the cell assignments and resolves them through the baSplit(first, second, …) call. Identical or unresolved arguments throw instead of guessing. Teachers/subjects patterns already matched and are unchanged.

Verification

  • New regression test with a fixture of the current shape (also proves the mapping follows the call by swapping the arguments, and that ambiguous input is rejected). tests/comcigan-source.test.mts: 7 pass.
  • Real getTimetable(1,1,{forceRefresh:true}) against the live provider: stale:false, fresh fetchedAt, same Monday grid as before.
  • Required CI is the authority for the full suite.

🤖 Generated with Claude Code

The provider again changed its renderer: the cell data is read into
arbitrarily named variables and passed to baSplit(daily, base, ...), so the
原자료/일일자료 assignments the parser looked for no longer exist and every
refresh failed (timetable stale since 2026-11-26 11:10 KST).

When those names are absent, find the two grid fields through the baSplit call:
its first argument is the current (daily) value, the second the original.
The old patterns are tried first; identical or unresolved arguments are
rejected instead of guessed. Verified against the live provider (stale=false).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WGLWH38z9TSjANcYp59QN
@lmwmason
lmwmason merged commit 76499fc into main Nov 26, 2026
2 of 3 checks passed
@lmwmason
lmwmason deleted the fix/comcigan-renderer-vars branch November 26, 2026 22:40
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.

2 participants