Repository navigation
fix: quote pantry section names containing spaces in TOML output - #296
Conversation
Section names with spaces (e.g. "Garage Freezer") were written without quotes, producing invalid TOML and corrupting pantry.conf on add/remove/ edit operations. Use toml_escape_key() for section headers, matching the existing escaping already applied to item keys. Fixes #292
|
test comment |
The "spice rack" section was written as [spice rack] which is invalid TOML — section names containing spaces must be quoted. This caused the entire pantry.conf to fail parsing, making the pantry appear empty in the web UI.
Code ReviewSummary: Clean, minimal fix for a real data-corruption bug. The root cause is clear and both serialization paths are correctly patched. What works well
Minor observationsDuplicated Incomplete special-character coverage in No automated tests — acknowledged in CLAUDE.md as the current project state. The manual test plan in the PR description is adequate for now. VerdictThe fix is correct and well-scoped. The two observations above are pre-existing issues and do not block merging. Good to go. |
|
Review: fix: quote pantry section names containing spaces in TOML output Summary: Correct, minimal fix for a real TOML serialization bug. The change is consistent with the existing pattern already applied to item keys. What is Good:
Minor Observations:
Verdict: The fix is correct and safe to merge. The observations above are pre-existing issues not introduced here. |
Summary
["Garage Freezer"]) were written without quotes during add/remove/edit operations, corruptingpantry.conftoml_escape_key()to section name serialization in bothsrc/server/handlers/pantry.rsandsrc/pantry.rs, matching the escaping already used for item keysFixes #292
Test plan
pantry.confwith a section like["Garage Freezer"]cook serverto add/edit/remove items in that section