davidhealey / waistline

Libre calorie counter app for Android. Built with Cordova.
568 stars 67 forks source link

Rescanning bar code does not download updated info from OFF #288

Closed prysm1 closed 3 years ago

prysm1 commented 3 years ago

This is probably a low priority Deleting an item from the Food table and re-scanning of the bar code reuses the the old info.

Work around was to unlink the food entry and edit the information manually

davidhealey commented 3 years ago

The intended behaviour is to first search the local database, if no result is found it then searches OFF. When item's are deleted they are not really deleted, they are marked as archived and hidden. This means they'll still show up in historic diary entries and statistics.

I could change the behaviour for archived items so it searches OFF first. What do you think?

prysm1 commented 3 years ago

The current behaviour is probably ok. As i am a very new user of waistline and not sure how everyone else is using it. The reason i noticed this is, I find that some of the entries from OFF are not very good(my opinion only). So i tried to fix the entry through the OFF website and then wanted to sync the new information.

I think will just close this for now. I think the work around is good enough for me. Thanks for looking into this.

davidhealey commented 3 years ago

I like the idea, it makes sense to me, so let's reopen this

prysm1 commented 3 years ago

ok. we would probably need a way to determine which data source is newer, otherwise it might clobber each others data.

edit: oh we can always just check if the item has been archived. during barcode scan, if item is archived or does not exist locally then use OFF data first.

davidhealey commented 3 years ago

https://github.com/davidhealey/waistline/commit/49171a6a01a2882d63091227dba2e96b8a2576c5