Skip to content

Fix Komga import progress, MU author lookup, and poll-failure logic#25

Merged
gregoryn22 merged 5 commits into
masterfrom
claude/optimistic-cartwright-67b105
May 29, 2026
Merged

Fix Komga import progress, MU author lookup, and poll-failure logic#25
gregoryn22 merged 5 commits into
masterfrom
claude/optimistic-cartwright-67b105

Conversation

@gregoryn22
Copy link
Copy Markdown
Owner

Summary

Bug-fix pass over the polling engine, Komga import path, and DB docs. Five logical commits, no behavior changes beyond the fixes.

Fixes

  1. Komga import live-progress unblocked/api/komga/import/progress acquired the same lock the import holds for its full duration, so every poll blocked until the import finished. Reader now reads the progress dict lock-free.
  2. MU author lookup in Komga-import path — used a.get("name") but MangaUpdates returns author_name, so authors were never populated from this fallback. Now matches every other MU call site.
  3. Power-of-2 gate precedenceratio & (ratio - 1) != 0 parsed as ratio & ((ratio - 1) != 0) (!= binds tighter than &). With small poll-failure thresholds this fired alerts at non-doubling counts. Parenthesized.
  4. Komga global-error handlers — on server-wide auth/connection errors the handler marked every series in the batch failed, including ones already polled successfully, inflating backoff counters. Now marks only the current series, then breaks.
  5. Stale commentuser_rating snaps to 0.5 increments, not integers.

Testing

  • py_compile + AST parse pass on all changed files.
  • No test suite in repo. Recommend manual smoke test of Komga import + /api/komga/import/progress polling mid-run before merge.

🤖 Generated with Claude Code

gregoryn22 and others added 5 commits May 28, 2026 14:56
The progress endpoint acquired the same lock the import holds for its full
duration, so every poll blocked until the import finished — live progress
never updated. Read the progress dict without the lock instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
MangaUpdates returns author objects keyed by author_name, not name, so the
list comprehension always produced an empty list and authors were never
populated from this fallback path. Matches every other MU call site.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
`!=` binds tighter than `&`, so `ratio & (ratio - 1) != 0` evaluated as
`ratio & ((ratio - 1) != 0)` rather than the intended power-of-2 test. With
small failure thresholds this fired alerts at non-doubling failure counts.
Parenthesize the bitwise op.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
On a server-wide auth/connection error the handler marked every series in the
batch as failed — including ones already polled successfully earlier in the
loop, overwriting their success and inflating backoff counters. Mark only the
current series, then break.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ratings snap to 0.5 increments, not integers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@gregoryn22 gregoryn22 merged commit 5e96c15 into master May 29, 2026
1 check passed
@gregoryn22 gregoryn22 deleted the claude/optimistic-cartwright-67b105 branch May 29, 2026 11:29
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