Skip to content

fix: retry unmatched Civitai metadata lookups - #20001

Closed
er-s-an wants to merge 1 commit into
Comfy-Org:mainfrom
er-s-an:fix/civitai-unmatched-metadata-retry
Closed

er-s-an wants to merge 1 commit into
Comfy-Org:mainfrom
er-s-an:fix/civitai-unmatched-metadata-retry

Conversation

@er-s-an

@er-s-an er-s-an commented Oct 3, 2026 •

Copy link
Copy Markdown

Summary

Allow later Civitai metadata lookups to retry when a successful response contains no matching file.

Changes

  • Cache Civitai metadata only after the response contains a matching file.
  • Replace the previous no-match caching assertion with empty/non-matching response regressions that recover on the next lookup and then reuse the valid cached result.
  • Preserve in-flight deduplication and caching of matching files with unknown size.

Review Focus

#14348 deliberately cached successful no-match responses to avoid repeated requests. This narrowly changes that contract in response to the minimum follow-up requested in #19879. Repeated lookups after an unmatched response can now issue another API request.

Refs #19879 (cache portion only). This does not close the issue: the broader outcome vocabulary and unsupported-URL parser behavior deferred from #15872 remain unchanged. Current main has fetchModelMetadata, not the stacked PR's resolution-status API.

Tests

  • Before the fix: both retry regressions failed against unchanged production code (65 passed, 2 failed).
  • After the fix: 10 missing-model suites / 284 tests passed with retries disabled and shuffle seed 19879; the changed suite alone passed all 67 tests with seed 713.
  • Scoped type-aware lint, format, and Vue typecheck passed using Node 26.8.2 / pnpm 11.13.1.
  • The broader suite emitted non-failing happy-dom DNS warnings from HuggingFace link-click tests. No live Civitai behavior was verified.
  • Full-repository checks, browser tests, build, and CI were not run locally.

Browser E2E was not run: reproducing this exact provider-response transition in a browser would require a mocked Civitai sequence and workflow/UI setup. The focused tests directly exercise the public fetchModelMetadata boundary with those controlled responses, verifying that a later lookup recovers and the valid result is cached.

Assistance

Prepared with AI assistance; the regression was reproduced before the fix and the scoped checks above were run against the final patch.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ⏳ Running...

🎨 Storybook: 🚧 Building...

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: dd2fb24f-5380-421b-810f-8d5beeca3cc2
📥 Commits

Reviewing files that changed from the base of the PR and between cb92c22 and dd99744.

📒 Files selected for processing (2)
  • src/platform/missingModel/missingModelDownload.test.ts
  • src/platform/missingModel/missingModelDownload.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Civitai metadata responses are cached only when they contain a file matching the requested download URL. Tests cover retry behavior, concurrent lookups, and matching files with an unknown size.

Changes

Civitai Metadata Lookup

Layer / File(s) Summary
Matching-file cache eligibility
src/platform/missingModel/missingModelDownload.ts, src/platform/missingModel/missingModelDownload.test.ts
Responses without a matching file are not cached, allowing later lookups to retry. Tests verify retries, shared requests for concurrent lookups, and caching a matching file with size zero.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: drjkl

Merge Risk: ⚪ Minimal · up to dd997

No merge-blocking issue is identified; normal checks remain appropriate before merging.

Architecture Summary

Architecture risk: 🔵 Low · up to dd997

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/platform/missingModel/missingModelDownload.test.ts: Replaces the test that expected successful Civitai responses with no files to be cached. The new parameterized test checks that an empty file list or a list containing only a non-matching URL returns null metadata initially, then retries and obtains the matching file’s size; subsequent calls use the cached result, with two total API requests.
  • observed — Modified behavior in src/platform/missingModel/missingModelDownload.test.ts: Adds a test that concurrent Civitai metadata lookups with no matching file both return null metadata while issuing only one API request.
  • observed — Modified behavior in src/platform/missingModel/missingModelDownload.test.ts: Adds a test that a matching Civitai file with size zero returns null file size and is cached for the next lookup.
  • observed — Modified behavior in src/platform/missingModel/missingModelDownload.ts: Civitai metadata responses are now cacheable only when matchingFile exists; successful responses without a matching file are no longer cached.
🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ⚠️ Warning The PR title and commit subject use the bug-fix signal “fix.” The PR changes src/platform/missingModel/missingModelDownload.ts and its test, but no changed file is under browser_tests/. The PR des… Add or update a Playwright regression test under browser_tests/, or add a concrete explanation in the PR description of why an end-to-end regression test is not practical.
✅ Passed checks (6 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Website End-To-End Regression Coverage ✅ Passed The changed files are src/platform/missingModel/missingModelDownload.ts and its test. No files under apps/website/src/ or apps/website/public/ changed, so this check does not apply.
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed files are src/platform/missingModel/missingModelDownload.test.ts and src/platform/missingModel/missingModelDownload.ts. Neither file is under src/lib/litegraph/, src/ecs/, nor rela…
Title check ✅ Passed The title clearly and concisely describes the main change: retrying Civitai metadata lookups when no matching file is found.
Description check ✅ Passed The description covers the summary, changes, review focus, and test results. It explains the scope and limitations of the change. The screenshots section is not needed for this code-only change.
Full details: End-To-End Regression Coverage For Fixes

Explanation

The PR title and commit subject use the bug-fix signal “fix.” The PR changes src/platform/missingModel/missingModelDownload.ts and its test, but no changed file is under browser_tests/. The PR description does not give a concrete reason why an end-to-end regression test is not practical. It says that no live Civitai behavior was verified, but that is not an explanation for omitting the test.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@er-s-an

er-s-an commented Oct 20, 2026

Copy link
Copy Markdown
Author

Closing this to keep my open PRs focused, since it hasn't gotten traction. Thanks for maintaining the project. Happy to reopen if it's still useful.

@er-s-an er-s-an closed this Oct 20, 2026
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