Skip to content

pantry.conf missing attributes when configured using UI #249

@kferns137

Description

@kferns137

cookcli v0.21.0

While using the server to add/edit panty items, the entered attributes of items are not saved in pantry.conf and as a result will be lost when the pantry page is reloaded. The following behaviour is observed-

  • If the pantry item contains name, quantity and any other attributes, ONLY name and quantity are saved to pantry.conf.
  • If pantry item contains name and other attributes EXCEPT quantity, these are correctly saved to pantry.conf but any attempt to add quantity will result in behaviour described in the previous point.

I did a little digging and believe the bug may be due to the use of if.. elseif logic in the function write_pantry_item (src/server/handlers/pantry.rs). I made a modification as shown in the Image 1 and it seems to have fixed the issue. I don't mean to propose this "hot-fix" as a solution though, hence reporting it as a bug so it can be looked into properly.

Image 1: Original source code (left), modified code (right)
Image

Thanks!
Kenneth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions