fix: properly quote base and pm_agent in write_index calls #194
Reference in New Issue
Block a user
Delete Branch "fix/issue-write-index-quoting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
kugetsu initfails with "write_index would create malformed JSON" error because whenbaseorpm_agentare not null, they were not being quoted properly inwrite_indexcalls.The index JSON was being written as:
Note:
baseis unquoted butpm_agentis quoted - invalid JSON.Fix
Properly quote
baseandpm_agentwith escaped quotes (\"\") when they are not null in allwrite_indexcalls:set_base_in_index: quote pm_agent when not nullset_pm_agent_in_index: quote base when not nulladd_issue_to_index: quote both base and pm_agent when not nullremove_issue_from_index: quote both base and pm_agent when not nullWhen base or pm_agent are not null, they need to be quoted with escaped quotes ("") in write_index calls. This fixes 'write_index would create malformed JSON' error during init.