Skip to content

feat: add one resume action during modpack install if abort - #242

Draft
HowXu wants to merge 13 commits into
FreesmTeam:developfrom
Nibelungorum:feat/206-abort-download-with-one-save-dialog
Draft

HowXu wants to merge 13 commits into
FreesmTeam:developfrom
Nibelungorum:feat/206-abort-download-with-one-save-dialog

Conversation

@HowXu

@HowXu HowXu commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary

from #206 , which discusses some features for the users who do not have a good networks or for the situation that network not work well

This PR adds resumable installation for Modrinth and CurseForge modpacks, helping users avoid downloading completed files again when their connection is unreliable. And one new global setting, disabled by default, lets users keep incomplete instances automatically without dialog. Choosing not to keep the instance preserves the existing cleanup behavior.

Large scope changes

This feature involves one large scope of adjustment in launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp and launcher/modplatform/flame/FlameInstanceCreationTask.cpp. I move the core download functions to the XXXInstallTask.cpp. I think if there is one class named XXXInstallTask, it should contains the code about download (but they are in the XXXInstanceCreationTask). Meanwhile, the download codes will be reused in the resume task.

If it's not suitable for the project, just tell me and I will do the modification

Test

Some simple tests

Manual testing of Modrinth and CurseForge installation and recovery was performed on Kali Linux, kernel 7.0.12, using Wayland with niri.

Keep

Unfortunately, this feature only implement for modrinth and curseforge modpack. other platforms are outside the scope of this PR. Platforms such as FTB, ATLauncher, and Technic use different manifests or installation workflows and require separate adaptations.

@so5iso4ka so5iso4ka added [1.1] : Freesm FreesmLauncher component [2.2] : Enhancement Improvement to existing functionality. [3.4] : Platform: Cross-Platform Tasks affecting all platforms. [4.1] : Component: Installation Related to managing Minecraft installations. [5.0] : User: End-Users Tasks aimed at end-users. labels Oct 24, 2026
@HowXu
HowXu force-pushed the feat/206-abort-download-with-one-save-dialog branch from d0a41ae to cc4cded Compare October 24, 2026 11:11
@so5iso4ka

Copy link
Copy Markdown
Member

Couldn't we achieve the same goal by keeping the current behavior and caching modpack content instead?

@s0me1newithhand7s

s0me1newithhand7s commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Couldn't we achieve the same goal by keeping the current behavior and caching modpack content instead?

+++
we wanna keep current behaviour

ed: stupid fucking idiot, absolute bafoon

@HowXu

HowXu commented Oct 24, 2026

Copy link
Copy Markdown
Author

Couldn't we achieve the same goal by keeping the current behavior and caching modpack content instead?

uhh, my bad English makes me do not completely understand your lines. The behavior of this pr is: I add one dialog when abort download or the download was aborted by bad networks, If choose "Yes" meaning keeping the content we have downloaded, then the modpack will be cached and one new instance was also created. If choose "No", the content was dropped, just behave like recent.

So does the line above meaning, uhh, like defaultly keeping the modpack cache and create one new instance ?

Just tell me more details

@notwindstone

notwindstone commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Couldn't we achieve the same goal by keeping the current behavior and caching modpack content instead?

uhh, my bad English makes me do not completely understand your lines. The behavior of this pr is: I add one dialog when abort download or the download was aborted by bad networks, If choose "Yes" meaning keeping the content we have downloaded, then the modpack will be cached and one new instance was also created. If choose "No", the content was dropped, just behave like recent.

So does the line above meaning, uhh, like defaultly keeping the modpack cache and create one new instance ?

Just tell me more details

He was saying that the solution to the problem might be more simple - just keep the downloaded modpack files in a shared cache folder. if something failed, the cached modpack files will be still present, and following retries will download only those files that are absent from cache

@notwindstone

Copy link
Copy Markdown
Member

Couldn't we achieve the same goal by keeping the current behavior and caching modpack content instead?

uhh, my bad English makes me do not completely understand your lines. The behavior of this pr is: I add one dialog when abort download or the download was aborted by bad networks, If choose "Yes" meaning keeping the content we have downloaded, then the modpack will be cached and one new instance was also created. If choose "No", the content was dropped, just behave like recent.

So does the line above meaning, uhh, like defaultly keeping the modpack cache and create one new instance ?

Just tell me more details

He was saying that the solution to the problem might be more simple - just keep the downloaded modpack files in a shared cache folder. if something failed, the cached modpack files will be still present, and following retries will download only those files that are absent from cache

probably need to clarify as well these things:

  • no need for the dialog - so yes, treat it as "by default, keep the downloaded files"
  • the proposed implementation keeps downloaded modpack files in the instance folder instead of the cache folder, independent of instance

@HowXu

HowXu commented Oct 24, 2026

Copy link
Copy Markdown
Author

Then I get.

Thanks a lot

@HowXu

HowXu commented Oct 24, 2026

Copy link
Copy Markdown
Author

some more details needs discuss below:

Where to keep the files already downloaded? Typically when install one mod pack, there will be modpack files(almost be downloaded from one single archive, and unzip, this will always keep stable), download mod files. The game sources download have already been cached.So what we care is the mod downloaded. In recent implement, I record one another manifest cut from the modpack mainfest, then the download will always be started if the files in the cut json do not be done. the downloaded mod files will directly send to the modpack instance's mods folder.

One more thing, if my understanding is right, after any abort of the modpack installation, there will always be one new instance?(so users can decide whether to delete) Or manage one another cache folder for the aborted instance? I do not suggest the second because we must control how to clean the cache, when to clean the cache and if the user restart the installation, we need check whether it's continuation or new installation, and even so more(but if it's better for the project, I will try my best).

HowXu added 13 commits October 26, 2026 14:15
Add native files-only filtering and atomic persistence, with one lightweight Qt Test target.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Distinguish network failures from local and parsing errors, clear stale replies on retries, and close canceled sinks before completion. Cover retry followed by local failure using real loopback networking.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Add the default-off automatic keep setting and shared creation handling. Preserve supported new instances after content interruption or game dependency network failure without changing Skip.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Share content installation between creation and resume, retain native pending entries, reuse validated files, and drain writes before a keep decision.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Resolve remaining native IDs, retain interrupted downloads, validate manual files and resource processing, and rollback uncommitted worlds safely.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Resume content before normal launch steps, reject explicit offline launches with pending content, and remove markers only after successful completion.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Keep successful requests without a valid landed file pending for fallback URLs, and verify SHA-512 before optional cleanup or manifest filtering.

Assisted-by: OpenCode:gpt-6.1-sol-fast
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
…fault action

Signed-off-by: HowXu <dev@howxu.cn>
@HowXu
HowXu force-pushed the feat/206-abort-download-with-one-save-dialog branch from 134a550 to 74906d1 Compare October 26, 2026 06:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[1.1] : Freesm FreesmLauncher component [2.2] : Enhancement Improvement to existing functionality. [3.4] : Platform: Cross-Platform Tasks affecting all platforms. [4.1] : Component: Installation Related to managing Minecraft installations. [5.0] : User: End-Users Tasks aimed at end-users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants