Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update need newer file #37

Merged

Conversation

SettingDust
Copy link
Contributor

When targeting multi loader mods. Some mod has older version that mark as supporting prefer loader sorted by #36 will become the first.
This PR make the update require the files on particular platform newer than the local by recording the publishing date for project files.

@SettingDust SettingDust marked this pull request as draft October 7, 2024 15:15
@SettingDust SettingDust marked this pull request as ready for review October 8, 2024 05:00
acc -= accProject
acc += combinedProject
}
val accFiles = projectsToFiles[accProject]!!
Copy link
Owner

Choose a reason for hiding this comment

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

This should be nullable

Copy link
Contributor Author

@SettingDust SettingDust Oct 8, 2024

Choose a reason for hiding this comment

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

The fold is iterating the keys of the map. And the lines below ensured the key exists. It's a bug if it's null

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, but it shouldn't throw NPE when there is a bug. Maybe the function should return a Result<MutableSet<Project>, ActionError>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How to describe the error?

Copy link
Owner

@juraj-hrivnak juraj-hrivnak Oct 8, 2024

Choose a reason for hiding this comment

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

UpdateFailed(val project: Project, val reason: String) : ActionError("Failed to update ${project.type} ${project.slug}; $reason")

For the message use ${project.getFullMsg()}
Also, the reason should tell what happened wrong.

@juraj-hrivnak juraj-hrivnak added the enhancement Enhancement of an existing feature label Oct 8, 2024
Copy link
Owner

@juraj-hrivnak juraj-hrivnak left a comment

Choose a reason for hiding this comment

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

Thanks a bunch!

@juraj-hrivnak juraj-hrivnak merged commit 52a0824 into juraj-hrivnak:main Oct 8, 2024
3 checks passed
@SettingDust SettingDust deleted the feature/updates-need-newer branch October 8, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of an existing feature
Projects
Status: Done🎉
Development

Successfully merging this pull request may close these issues.

2 participants