Skip to content

fix: steady the update check and list shared events once - #116

Merged
m1ngsama merged 3 commits into
mainfrom
fix/update-check
Nov 18, 2026
Merged

m1ngsama merged 3 commits into
mainfrom
fix/update-check

Conversation

@m1ngsama

@m1ngsama m1ngsama commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Hotfix for two problems in the published client: nbtca update failed on slow connections without saying why, and the club calendar showed some events twice.

Update check. It gave up after 3 seconds and printed only "无法检查更新". From this machine, 6 consecutive requests to the npm registry took 1.7 to 4.6 seconds, and one failed to connect, so two of the six would have failed the old check.

  • Each attempt now waits up to 8 seconds.
  • A dropped connection is retried once. A timeout is not retried, so the longest wait stays at 8 seconds.
  • The message names the cause: "连接 npm 超时,无法检查更新。", "无法连接 npm,检查更新失败。", or the old message for an error response. Every failure also prints "运行:npm i -g @nbtca/prompt".

Duplicate events. The club feed carries the biweekly "NWDC (待定)" series twice, once from Apple Calendar and once from Google Calendar, under different UIDs. Every session appeared twice on Home and in the Events lists, and counted twice in the heatmap and star map. Occurrences with the same title, start, end, and location now appear once, and the heatmap subtracts the repeats from its counts. Removing one of the two series from the club calendar would fix the source.

Test. "spells the countdown out in Chinese" failed in Pacific/Auckland, because its local-time fixture spans the start of New Zealand daylight saving time. It now uses +08:00 times.

Validation: npm run check passes, and the full suite passes in America/Los_Angeles, Pacific/Auckland, Asia/Kolkata, and UTC. nbtca events --month against the live feed lists the 11-27 NWDC session once.

@m1ngsama m1ngsama changed the title fix(update): wait longer for npm and say why a check failed fix: steady the update check and list shared events once Nov 18, 2026
@m1ngsama
m1ngsama merged commit 7fd8146 into main Nov 18, 2026
4 checks passed
@m1ngsama
m1ngsama deleted the fix/update-check branch November 18, 2026 07:45
@m1ngsama m1ngsama mentioned this pull request Nov 18, 2026
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