Skip to content

fix(utils): avoid panics when creating default ini sections#3892

Closed
SkenSMasteR wants to merge 1 commit into
spicetify:mainfrom
SkenSMasteR:main
Closed

fix(utils): avoid panics when creating default ini sections#3892
SkenSMasteR wants to merge 1 commit into
spicetify:mainfrom
SkenSMasteR:main

Conversation

@SkenSMasteR

@SkenSMasteR SkenSMasteR commented Jul 16, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Improved configuration setup resilience by reporting section-creation errors without terminating the application.
    • Continued processing available configuration sections when individual sections cannot be created.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 65b6f246-c526-4550-9bf3-26375f6ba159

📥 Commits

Reviewing files that changed from the base of the PR and between 1ff95d2 and a5eb225.

📒 Files selected for processing (1)
  • src/utils/config.go

📝 Walkthrough

Walkthrough

getDefaultConfig now reports failures from INI section creation with PrintError instead of panicking. Regular section creation continues after failures, while the Backup section is populated only when its creation succeeds.

Changes

Default configuration generation

Layer / File(s) Summary
Section creation error handling
src/utils/config.go
getDefaultConfig logs failures when creating configured sections or the Backup section, continues processing regular sections, and preserves Backup initialization on successful creation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: replacing panics with error logging when creating default INI sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@rxri

rxri commented Jul 16, 2026

Copy link
Copy Markdown
Member

That's actually good that spicetify panics. Config shouldn't generate half-filled in

@rxri rxri closed this Jul 16, 2026
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