MalteJanz / sw-sync-cli

CLI for fast and flexible data transfer between shopware and (CSV) files over API
MIT License
3 stars 3 forks source link

More robust import error handling #12

Open MalteJanz opened 1 month ago

MalteJanz commented 1 month ago

Currently if a sync API request fails for import:

There should also be a more general error handling if the above doesn't work:

See src/data/import.rs

MalteJanz commented 1 month ago

Also the current implementation may actually be wrong. There could be multiple errors for a single line and in that case it might actually remove some valid lines too 🙈

See: https://github.com/MalteJanz/sw-sync-cli/blob/c07d7f863f8e923133b87d29fbd58d8f0abb6a31/src/data/import.rs#L115

It stores to_be_removed in a Vec, so it could contain the same index twice. Maybe we should use a HashSet instead or something else to ensure the indices are unique