jackwener/OpenCLI · error · CommandExecutionError

Xiaoyuzhou playback progress omitted requested eid ${episode

Error message

Xiaoyuzhou playback progress omitted requested eid ${episode.eid}; the history join is incomplete

What it means

The progress join must be complete: every episode collected from history must have a corresponding progress row. This error means at least one requested eid never appeared in the progress response, so the library cannot return a fully populated progress map and fails fast instead of returning partial data.

Source

Thrown at clis/xiaoyuzhou/history.js:139

        if (progressById.has(eid)) {
            throw new CommandExecutionError(`Xiaoyuzhou playback progress returned duplicate eid ${eid}`);
        }
        const pid = requiredId(row.pid, `progress pid in row ${index + 1}`);
        if (pid !== episode.pid) {
            throw new CommandExecutionError(`Xiaoyuzhou playback progress pid did not match history eid ${eid}`);
        }
        const progressSec = optionalSeconds(row.progress, `progress in row ${index + 1}`);
        if (progressSec !== null && episode.durationSec !== null && progressSec > episode.durationSec) {
            throw new CommandExecutionError(`Xiaoyuzhou playback progress exceeded duration for eid ${eid}`);
        }
        progressById.set(eid, {
            progressSec,
            playedAt: optionalIsoTime(row.playedAt, `playedAt in row ${index + 1}`),
        });
    }
    for (const episode of episodes) {
        if (!progressById.has(episode.eid)) {
            throw new CommandExecutionError(
                `Xiaoyuzhou playback progress omitted requested eid ${episode.eid}; the history join is incomplete`,
            );
        }
    }
    return progressById;
}

async function fetchHistory(args = {}) {
    const fetchAll = args.all ?? false;
    if (typeof fetchAll !== 'boolean') {
        throw new ArgumentError('--all must be a boolean');
    }
    const limit = fetchAll ? null : positiveInteger(args.limit ?? DEFAULT_LIMIT, 'limit', MAX_LIMIT);
    const maxPages = positiveInteger(args['max-pages'] ?? DEFAULT_MAX_PAGES, 'max-pages', HARD_MAX_PAGES);
    let credentials = loadXiaoyuzhouCredentials();
    const seenEpisodeIds = new Set();
    const seenCursors = new Set();
    const rows = [];

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Compare the missing eids against a raw progress response to see whether the API truly omitted them.
  2. Ensure your progress fetch paginates until it covers all requested eids rather than stopping after one page.
  3. Normalize eids (trim, lowercase) consistently before both fetches if any preprocessing is applied.
  4. Fetch progress per-episode for missing eids, or treat missing progress as null if your handling allows it.

Example fix

// before
const rows = await fetchProgressPage(page1Cursor);
return parseProgressRows(rows, episodes);
// after
let rows = [];
let cursor = null;
do {
  const page = await fetchProgressPage(cursor);
  rows = rows.concat(page.entries);
  cursor = page.next;
} while (cursor && !coversAllEids(rows, episodes));
return parseProgressRows(rows, episodes);
Defensive patterns

Strategy: try-catch

Validate before calling

const missing = episodes.filter(ep => !eidSet.has(ep.eid));
if (missing.length) console.warn('eids not present in progress response:', missing.map(e => e.eid));

Try / catch

try {
  const progress = progressById(episodes);
} catch (e) {
  if (e instanceof CommandExecutionError && /omitted requested eid/.test(e.message)) {
    console.warn('Incomplete progress join:', e.message); // degrade gracefully
  } else throw e;
}

Prevention

When it happens

Trigger: The progress endpoint returns fewer rows than the requested episodes — e.g. the API drops recently added episodes, a paginated progress fetch stops early, or eid values differ subtly (whitespace/case) between history and progress responses.

Common situations: Newly played episodes not yet indexed by the progress endpoint; truncated progress pages due to a pagination bug; unnoticed server-side filtering; string normalization differences on eids introduced by local preprocessing.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/974bd04adcd8cc8d. Report an issue: GitHub.