Conversation
Contributor
Reviewer's Guide将 Fabric API 兼容性检测从解析显示名称改为使用原始游戏版本元数据,引入 CompFile 上的 RawGameVersions 字段以存储未处理的游戏版本标识符,并简化 UI 中显示的 Fabric API 版本文本:移除对 '+' 的额外拆分,同时保持序列化和加载器检测与新字段同步。 使用 RawGameVersions 进行 Fabric API 兼容性检查的时序图sequenceDiagram
participant PageDownloadInstall
participant FabricApi as CompFile_FabricApi
PageDownloadInstall->>FabricApi: get DisplayName
PageDownloadInstall->>PageDownloadInstall: normalize _vanillaName to targetName
PageDownloadInstall->>FabricApi: access RawGameVersions
FabricApi-->>PageDownloadInstall: List~string~ RawGameVersions
PageDownloadInstall->>PageDownloadInstall: Any(f == targetName)
alt any_match
PageDownloadInstall-->>PageDownloadInstall: Return True (compatible)
else no_match
PageDownloadInstall-->>PageDownloadInstall: Return False (not compatible)
end
更新后 CompFile 游戏版本字段的类图classDiagram
class CompFile {
+List~CompLoaderType~ ModLoaders
+List~string~ RawGameVersions
+List~string~ GameVersions
+List~string~ DownloadUrls
+List~string~ RawDependencies
+List~string~ Dependencies
+string DisplayName
+string StatusDescription
+DateTime ReleaseDate
+int DownloadCount
+string FileName
+JObject ToJson()
}
class CompLoaderType {
<<enumeration>>
Forge
Fabric
Quilt
NeoForge
}
CompFile "1" --> "*" CompLoaderType : uses
CompFile "1" --> "*" RawGameVersions : stores
CompFile "1" --> "*" GameVersions : derives_from
文件级变更
与关联 Issue 的对照评估
可能相关的 Issue
Tips and commandsInteracting with Sourcery
Customizing Your Experience打开你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideRefactors Fabric API compatibility detection to use raw game version metadata instead of parsing display names, introduces a RawGameVersions field on CompFile for storing unprocessed game version identifiers, and simplifies Fabric API version text shown in the UI by removing extra splitting on '+' while keeping serialization and loader detection in sync with the new field. Sequence diagram for Fabric API compatibility check using RawGameVersionssequenceDiagram
participant PageDownloadInstall
participant FabricApi as CompFile_FabricApi
PageDownloadInstall->>FabricApi: get DisplayName
PageDownloadInstall->>PageDownloadInstall: normalize _vanillaName to targetName
PageDownloadInstall->>FabricApi: access RawGameVersions
FabricApi-->>PageDownloadInstall: List~string~ RawGameVersions
PageDownloadInstall->>PageDownloadInstall: Any(f == targetName)
alt any_match
PageDownloadInstall-->>PageDownloadInstall: Return True (compatible)
else no_match
PageDownloadInstall-->>PageDownloadInstall: Return False (not compatible)
end
Class diagram for updated CompFile game version fieldsclassDiagram
class CompFile {
+List~CompLoaderType~ ModLoaders
+List~string~ RawGameVersions
+List~string~ GameVersions
+List~string~ DownloadUrls
+List~string~ RawDependencies
+List~string~ Dependencies
+string DisplayName
+string StatusDescription
+DateTime ReleaseDate
+int DownloadCount
+string FileName
+JObject ToJson()
}
class CompLoaderType {
<<enumeration>>
Forge
Fabric
Quilt
NeoForge
}
CompFile "1" --> "*" CompLoaderType : uses
CompFile "1" --> "*" RawGameVersions : stores
CompFile "1" --> "*" GameVersions : derives_from
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
- 建议在缓存/JSON 中不包含
RawGameVersions时,始终将它初始化为非空列表(例如New List(Of String)),以避免在调用.Any或使用New JArray(RawGameVersions)进行序列化时出现潜在的NullReferenceException。 - 新的 Fabric API 兼容性检查对
RawGameVersions采用的是精确相等判断;如果之前对_vanillaName的部分匹配或格式化变体(例如快照/预览别名)是可以匹配的,你可能需要保留或显式重新实现必要的标准化逻辑,以避免出现回归。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Consider ensuring `RawGameVersions` is always initialized to a non-null list (e.g., `New List(Of String)`) when the cache/json does not contain `RawGameVersions`, to avoid potential `NullReferenceException` when calling `.Any` or when serializing with `New JArray(RawGameVersions)`.
- The new Fabric API compatibility check uses an exact equality against `RawGameVersions`; if partial or formatted variants of `_vanillaName` previously matched (e.g., snapshot/preview aliases), you may want to preserve or explicitly reimplement any necessary normalization to avoid regressions.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- Consider ensuring
RawGameVersionsis always initialized to a non-null list (e.g.,New List(Of String)) when the cache/json does not containRawGameVersions, to avoid potentialNullReferenceExceptionwhen calling.Anyor when serializing withNew JArray(RawGameVersions). - The new Fabric API compatibility check uses an exact equality against
RawGameVersions; if partial or formatted variants of_vanillaNamepreviously matched (e.g., snapshot/preview aliases), you may want to preserve or explicitly reimplement any necessary normalization to avoid regressions.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider ensuring `RawGameVersions` is always initialized to a non-null list (e.g., `New List(Of String)`) when the cache/json does not contain `RawGameVersions`, to avoid potential `NullReferenceException` when calling `.Any` or when serializing with `New JArray(RawGameVersions)`.
- The new Fabric API compatibility check uses an exact equality against `RawGameVersions`; if partial or formatted variants of `_vanillaName` previously matched (e.g., snapshot/preview aliases), you may want to preserve or explicitly reimplement any necessary normalization to avoid regressions.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
SALTWOOD
approved these changes
Apr 16, 2026
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.
close #2701
上游:Meloong-Git/PCL#8460
Summary by Sourcery
通过利用存储的原始游戏版本数据来修复 Fabric API 版本兼容性检测,并相应调整 Fabric API 的显示标题。
Bug 修复:
改进:
RawGameVersions字段,以保留未经处理的游戏版本标识符,从而实现更精确的逻辑。Original summary in English
Summary by Sourcery
Fix Fabric API version compatibility detection by leveraging stored raw game version data and adjust Fabric API display titles accordingly.
Bug Fixes:
Enhancements: