Skip to content

fix: improve check-in reliability, decompression handling, and input parsing - #27

Open
ismlEraslan wants to merge 2 commits into
sglkc:masterfrom
ismlEraslan:fix/checkin-reliability
Open

fix: improve check-in reliability, decompression handling, and input parsing#27
ismlEraslan wants to merge 2 commits into
sglkc:masterfrom
ismlEraslan:fix/checkin-reliability

Conversation

@ismlEraslan

Copy link
Copy Markdown

Summary of Changes

This PR resolves issues with failed check-ins, fixes response decompression handling, and adds safeguards for common user configuration issues:

  1. Fix Response Decompression in Node.js:

    • Removed manual �ccept-encoding: gzip, deflate, br, zstd and connection: keep-alive headers.
    • Forcing zstd can cause Cloudflare/HoYoLAB to return zstd-compressed responses that Node.js native etch (undici) does not automatically decompress, resulting in
      es.json() decompression/parse errors. Removing manual encoding headers lets Node's native fetch negotiate supported encodings (gzip, deflate, �r) seamlessly.
  2. Secret & Variable Fallbacks in Actions Workflow:

    • Updated login.yml so that COOKIE, GAMES, and HOYOLAB_LANG accept values from either GitHub Actions secrets or �ars (e.g. ${{ secrets.COOKIE || vars.COOKIE }}). This prevents crashes when users configure GAMES as a Secret or COOKIE as a Variable.
  3. Schedule Right After Daily Reset:

    • HoYoLAB daily check-in resets at 00:00 UTC+8 (16:00 UTC). Added a scheduled run at 16:30 UTC (00:30 UTC+8) shortly after reset, while keeping 22:15 UTC (06:15 UTC+8) as a morning backup check.
  4. Input Sanitization & Game Aliases:

    • Strips accidental surrounding quotes and whitespace from cookies and game lists.
    • Splits game inputs by commas or spaces (gi, hsr or gi hsr).
    • Added common aliases (e.g. genshin -> gi, starrail -> hsr, zenless -> zzz).
  5. Enhanced Error Messages:

    • Added friendly handling for
      etcode: 1034 (Risk system / CAPTCHA verification required), advising users to check in manually once on the site/app to clear verification.
    • Displays HoYoLAB's actual json.message in error logs instead of generic messages.

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