Repository navigation
fix(workbuddy): correct CN check-in timezone and error reporting - #275
Open
EchoChan314 wants to merge 2 commits into
Open
EchoChan314 wants to merge 2 commits into
EchoChan314 wants to merge 2 commits into
Conversation
Pin WorkBuddy CN check-in times to Asia/Shanghai instead of the process local timezone. The supported Docker Compose install sets no TZ, so `Local` resolved to UTC and both the trigger time and the already-checked-in day boundary sat eight hours off the upstream's UTC+8 quota reset. Qoder CN and Trae CN already pin this zone. Also return the transport error from DailyCheckin. `do` yields a nil body and a zero status when the request itself fails, and the retry loop's error was never inspected, so a dropped connection or timeout surfaced as `checkin parse: unexpected end of JSON input` and hid the real cause.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Asia/Shanghaiinstead of the process local timezone.Localresolves to the container's zone, and the supported Docker Compose install sets noTZ, so the configured time was treated as UTC: check-ins fired eight hours off the intended local time, andCheckedInLocalDayplaced the "already checked in today" boundary eight hours away from the upstream's UTC+8 quota reset. Qoder CN and Trae CN already pin this zone. The global region keepsLocalbecause its reset zone is unverified.DailyCheckinnow returns the transport error fromdo. The retry loop assignederrand never inspected it, so a nil body reachedjson.Unmarshal, and a dropped connection, TLS failure or timeout was reported ascheckin parse: unexpected end of JSON input. That message is what a week of failed daily check-ins looked like, and it read as a malformed response rather than a transport failure. The Trae adapter already surfaces the same condition asEOF.Test plan
go test ./...go vet ./...cd worker && npm testcd frontend && npm run build && npm run lintchangelog/unreleased/<slug>.md, or this PR has no user-facing changeTestDailyCheckinSurfacesTransportErrorhijacks and closes the connection, then asserts the returned error is not a parse error. It overridesdailyCheckinRetryDelaysto{0, 0}the same way the existing retry tests do.The machine that produced this patch has no Go toolchain, so the Go steps were not run locally. The CI run on this PR is
action_required— a first-time contributor needs a maintainer to approve the workflow before any job executes — so nothing has run yet.