Skip to content

Feat/curse retry and cache - #6595

Open
fatelove42 wants to merge 2 commits into
HMCL-dev:mainfrom
fatelove42:feat/curse-retry-and-cache
Open

Feat/curse retry and cache#6595
fatelove42 wants to merge 2 commits into
HMCL-dev:mainfrom
fatelove42:feat/curse-retry-and-cache

Conversation

@fatelove42

@fatelove42 fatelove42 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

添加对api.curseforge.com的自动重试
修改原因:发现ATM这种整合包如果请求一个mod因为网络抖动失败(例如 projectID: 123456, fileID: 789012
请求api.curseforge.com/v1/mods/123456/files/789012)就会导致整个整合包升级失败
并在manifest.json中添加hashes字段实现curse类整合包mod下载的缓存利用

@github-actions github-actions Bot added the 40+ label Aug 3, 2026
@Glavo

Glavo commented Aug 13, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 273baf1140

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return file;
} catch (IOException | JsonParseException e) {
LOG.warning("Unable to fetch the file name projectID=" + file.projectID() + ", fileID=" + file.fileID(), e);
if (StringUtils.isBlank(file.fileName()) || file.url() == null || file.hashes() == null || file.hashes().isEmpty()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep missing hashes from invalidating completed manifests

When upgrading a manifest enriched by an earlier HMCL version, fileName and url are already usable but hashes is absent, so this condition now forces another CurseForge API request. If that request remains temporarily unavailable after the retries, or the API record was deleted while the CDN URL still works, the code sets allNameKnown/notFound and postExecute() fails the entire completion with ModpackCompletionException, even though the existing metadata is sufficient to download or retain the file. Hash enrichment should remain optional when the name and URL are already known.

Useful? React with 👍 / 👎.

@fatelove42
fatelove42 force-pushed the feat/curse-retry-and-cache branch from 273baf1 to 7e0f3eb Compare August 14, 2026 15:00
@github-actions github-actions Bot added 100+ and removed 40+ labels Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants