Block IDs regenerated on every preset load — toggle fails with Block not found #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Root cause: In
src/presets/manager.py,_preset_to_dict()did not serializeblock_id, so every save/load cycle regenerated them. Same bug insave_presetandsave_snapshotAPI endpoints —FXBlock()was constructed without passingblock_idfrom request data.Fix:
_preset_to_dict()now includes"block_id": block.block_idfor chain blocks and snapshot blockssave_presetPUT endpoint passesblock_id=b.get("block_id", "")toFXBlock()save_snapshotPOST endpoint passesblock_id=bd.get("block_id", "")toFXBlock()Verification: Block IDs are now stable across 5 consecutive
/api/statereads, persist to disk JSON, and block toggle PATCH works with the persisted ID.Commit:
c026bc7