Skip to content

publish: fix ModConfig.json regex inclusion duplicate check#817

Merged
Sewer56 merged 1 commit intoReloaded-Project:masterfrom
Nenkai:publish-config-fix
Feb 1, 2026
Merged

publish: fix ModConfig.json regex inclusion duplicate check#817
Sewer56 merged 1 commit intoReloaded-Project:masterfrom
Nenkai:publish-config-fix

Conversation

@Nenkai
Copy link
Contributor

@Nenkai Nenkai commented Feb 1, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue in the mod publishing dialog where ModConfig.json could be added multiple times to the included files list. The dialog now properly detects existing entries using case-insensitive comparison, preventing duplicate configurations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Feb 1, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Fixed duplicate-detection logic in PublishModDialogViewModel constructor to compare StringWrapper values instead of wrapper objects. Changed from direct Contains check to iterating wrapper entries and checking their Value property with case-insensitive matching.

Changes

Cohort / File(s) Summary
Dialog ViewModel Fix
source/Reloaded.Mod.Launcher.Lib/Models/ViewModel/Dialog/PublishModDialogViewModel.cs
Modified IncludeRegexes initialization to prevent duplicate "ModConfig.json" entries by checking wrapper values with case-insensitive comparison instead of comparing StringWrapper objects directly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A wrapper once tripped on its own,
Comparing wrong types, now plainly shown!
With .Value checked case-free and right,
"ModConfig" dupes vanish from sight.
The logic now hops without a care! 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sewer56
Copy link
Member

Sewer56 commented Feb 1, 2026

This is just a casing change.
image

But in the screenshot the casing is the same.
Anything I'm missing?

@Sewer56
Copy link
Member

Sewer56 commented Feb 1, 2026

Merging in any case, as names on Windows FileSystem are case insensitive, but nonetheless; kinda curious to know.

@Sewer56 Sewer56 merged commit 0b79fd6 into Reloaded-Project:master Feb 1, 2026
2 of 3 checks passed
@Nenkai
Copy link
Contributor Author

Nenkai commented Feb 1, 2026

Root issue is that List<T>.Contains calls Equals & StringWrapper doesn't implement it so it was always going to fail.
Casing was just incase but let me know if it should be changed.

@Sewer56
Copy link
Member

Sewer56 commented Feb 1, 2026

Ah, checks out. I didn't catch that was a stringwrapper from the web UI

@Nenkai Nenkai deleted the publish-config-fix branch February 1, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants