Skip to content

fix(douyin): make fast_detect retries independent of error wording - #2444

Open
asts-top wants to merge 1 commit into
jackwener:mainfrom
asts-top:fix/douyin-fast-detect-retry
Open

fix(douyin): make fast_detect retries independent of error wording#2444
asts-top wants to merge 1 commit into
jackwener:mainfrom
asts-top:fix/douyin-fast-detect-retry

Conversation

@asts-top

Copy link
Copy Markdown

Description

fast_detect currently decides whether to retry by searching error-message text. This makes retry behavior depend on wording and can silently stop working when the upstream response or wrapper changes.

This patch gives Douyin browser requests stable typed error metadata (errorCode, phase, HTTP/API status) while keeping the existing public COMMAND_EXEC envelope. publish now retries only transient failures from the fast_detect phase: empty responses, network failures, timeouts, and transport-level HTTP 404s. API-level 404s, parse failures, malformed responses, and other non-transient errors are surfaced without retrying.

The scope is intentionally limited to request classification and the fast_detect retry decision. Uploading, polling, create_v2, CLI arguments, and other adapters remain unchanged. Keeping the change focused preserves existing behavior, reduces regression and review cost, and makes verification of #2319 straightforward.

Related issue: Fixes #2319

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

Focused regression tests:

Test Files  2 passed (2)
Tests       31 passed (31)

Full Douyin adapter suite:

Test Files  25 passed (25)
Tests       210 passed (210)

Additional checks passed:

  • npm run typecheck
  • npm run build
  • npm run check:typed-error-lint
  • npm run check:silent-column-drop
  • node dist/src/main.js validate douyin
  • npm audit --registry=https://registry.npmjs.org/ --omit=dev --audit-level=high
  • git diff --check

The typed-error lint remained at current=130, baseline=130, new=0, and the silent-column-drop check remained at current=94, baseline=94, new=0.

Manual verification with a logged-in Douyin creator session confirmed that an empty fast_detect/pre_check response entered the retry path and allowed the pipeline to continue into polling. A later empty create_v2 response was observed separately; this PR does not claim to fix that downstream issue.

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.

fix(douyin): fast_detect retry is driven by error-message substrings, so it breaks silently when wording changes

1 participant