Repository navigation
fix: ensure overwrite works correctly when no missing models - #2154
Merged
Merged
Conversation
Contributor
WalkthroughRemoved an early return statement in the SyncUpstreamModels function that previously exited when the missing models list was empty. The function now continues executing downstream logic instead of short-circuiting with an empty response payload. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant SyncUpstreamModels as SyncUpstreamModels()
rect rgb(200, 220, 255)
Note over Caller,SyncUpstreamModels: Previous Behavior
Caller->>SyncUpstreamModels: Call
activate SyncUpstreamModels
SyncUpstreamModels->>SyncUpstreamModels: Check missing list
alt Missing is empty
SyncUpstreamModels-->>Caller: Return {created_models: 0, created_vendors: 0, skipped_models: []}
deactivate SyncUpstreamModels
end
end
rect rgb(220, 255, 220)
Note over Caller,SyncUpstreamModels: New Behavior
Caller->>SyncUpstreamModels: Call
activate SyncUpstreamModels
SyncUpstreamModels->>SyncUpstreamModels: Check missing list
alt Missing is empty (no early exit)
SyncUpstreamModels->>SyncUpstreamModels: Fetch upstream vendors/models
SyncUpstreamModels->>SyncUpstreamModels: Process downstream logic
SyncUpstreamModels-->>Caller: Return constructed response
deactivate SyncUpstreamModels
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
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. Comment |
Collaborator
|
没有未配置的模型就是要直接跳过同步的吧 |
Member
Author
t0ng7u
self-requested a review
December 25, 2025 14:32
ennnnny
pushed a commit
to ennnnny/new-api
that referenced
this pull request
Mar 17, 2026
fix: ensure overwrite works correctly when no missing models
salem-2007
added a commit
to salem-2007/new-api
that referenced
this pull request
Sep 10, 2026
fix: ensure overwrite works correctly when no missing models
junjundesk
pushed a commit
to junjundesk/new-api
that referenced
this pull request
Oct 3, 2026
fix: ensure overwrite works correctly when no missing models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

修复模型同步部分更新覆盖不生效的问题
当没有未配置模型时,覆盖更新逻辑会被跳过
Summary by CodeRabbit