Skip to content

fix(ic): end IC sessions on encode, not on queue - #199

Merged
Yueqiao12Zhang merged 1 commit into
mainfrom
issue-198
Aug 12, 2026
Merged

fix(ic): end IC sessions on encode, not on queue#199
Yueqiao12Zhang merged 1 commit into
mainfrom
issue-198

Conversation

@Yueqiao12Zhang

Copy link
Copy Markdown
Contributor

In manual IC, queueing a page called POST /api/ic/{session_id}/complete, which moves the IC session CLASSIFYING → EXPORT. That state is terminal, and IC's lookup() deliberately treats an EXPORT session as not resumable — so /ic/start staged a fresh session next time the page was opened. A page queued but never encoded (back to the project, or simply never pressing "encode batch") therefore lost every correction made in it.

Queueing now only records {image, sessionId} locally, and handleEncodeBatch is the one place a session is completed: it finalises each queued session, builds its buildEncodePair() pair, then hands the batch to the encoder. Up to that point every session stays editable and resumable, so abandoning the step costs nothing. A side effect worth having — the GameraXML snapshot is now taken after any edits made to a page following its queueing. The same deferral covers IC's in-iframe "queue page"/auto-export path (ic:auto-export), which already delegates completion to the host.

Also in here: queue/encode errors are now shown in the header. They were written to state but rendered only in the panel that replaces the iframe, so a failure looked like a no-op click — which matters more now that one click finalises N sessions. On failure the queue is left intact, and since IC allows re-export from EXPORT, pressing the button again retries the whole queue rather than dropping the pages that already worked.

Not addressed: the queue list itself is still component-local state, so leaving the view drops the checkmarks. The sessions behind them now survive and resume with their corrections intact, so re-queueing is a click — lifting the queue into AppRouter state would close that too, if we want it.

Verified with tsc -b and prettier; eslint on the touched file reports only two pre-existing react-hooks/set-state-in-effect errors on untouched effects (that rule already fires 48 times across src). There's no test runner in landing-page, and I didn't bring the six-process stack up, so this is statically checked rather than exercised end to end.

Closes #198

IC's /sessions/{id}/complete moves a session CLASSIFYING → EXPORT, which
is terminal, and IC's lookup() treats EXPORT as not resumable — so
/ic/start stages a fresh session for that page. Manual IC called it from
"queue page", so a page queued but never encoded (back to the project,
or simply never pressing "encode batch") silently lost every correction
made in it.

Queueing now only records {image, sessionId}; handleEncodeBatch is the
one place a session is completed, building each buildEncodePair() pair
there. The GameraXML snapshot is therefore taken after any edits made to
a page following its queueing, and the same deferral covers IC's
in-iframe auto-export path, which already delegates completion to the
host.

Also surface queue/encode errors in the header — they were written to
state but rendered only in the panel that replaces the iframe, so a
failure looked like a no-op click.
Copilot AI lite review requested due to automatic review settings August 12, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Yueqiao12Zhang, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 78a0ddbf-4d2c-4c5c-b59d-c0b09a1bf4fe

📥 Commits

Reviewing files that changed from the base of the PR and between 9a690ce and c35c532.

📒 Files selected for processing (3)
  • CLAUDE.md
  • landing-page/src/components/workflow/InteractiveClassifier.tsx
  • landing-page/src/utils/icQueue.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Yueqiao12Zhang
Yueqiao12Zhang merged commit 45f24b1 into main Aug 12, 2026
3 checks passed
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.

In IC, when a page is queued but not encoded, the progress get lost.

2 participants