Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meal plan re-adds items to shopping list after checking them off #3342

Closed
jmawet opened this issue Oct 2, 2024 · 6 comments
Closed

Meal plan re-adds items to shopping list after checking them off #3342

jmawet opened this issue Oct 2, 2024 · 6 comments

Comments

@jmawet
Copy link

jmawet commented Oct 2, 2024

Tandoor Version

1.5.19

Setup

Docker / Docker-Compose

Reverse Proxy

No reverse proxy

Other

No response

Bug description

When adding meal plans to the shopping list, I am no longer able to check off ingredients for more than a few minutes. The next refresh it will just add them back.

Relevant logs

Gunicorn Media: False
Sqlite:  False 
        PostgreSQL: 15 
        Debug: True
@vabene1111
Copy link
Collaborator

interesting, I am basically always using meal plan based shopping lists and never had this issue. Can you check the browser console if any errors are shown when you check of the shopping list items?

@jmawet
Copy link
Author

jmawet commented Oct 4, 2024

started loading locale messages
shopping_list_view.js:1 finished loading messages in  3  ms
shopping_list_view.js:1 loaded local user settings age 172898.395 
shopping_list_view.js:1 refreshing user settings from API
shopping_list_view.js:1 loaded local user settings age 172898.396 
shopping_list_view.js:1 refreshing user settings from API

manifest.json:1 Manifest: Enctype should be set to either application/x-www-form-urlencoded or multipart/form-data. It currently defaults to application/x-www-form-urlencodedUnderstand this warning
shopping/:1 <meta name="apple-mobile-web-app-capable" content="yes"> is deprecated. Please include <meta name="mobile-web-app-capable" content="yes">Understand this warning

13 shopping_list_view.js:1 running autosync

That last line "running autosync" pops up once I start checking items off the shopping list. The number (13 at the time of copy/paste) keeps increasing every 10-15 seconds. By the time I typed out this sentence it increased to 15. It seems like maybe this autosync is not working properly, so it's not saving in the db that it's checked off? I'll leave that browser tab open and I'll update here if anything changes in the console

@jmawet
Copy link
Author

jmawet commented Oct 4, 2024

Yeah autosync failed:

Triggered response ERROR
shopping_list_view.js:1 auto sync failed
(anonymous) @ shopping_list_view.js:1
Promise.catch
autosync @ shopping_list_view.js:1
(anonymous) @ chunk-vendors.js:347
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1Understand this warning
chunk-vendors.js:347 
        
        
       GET https://cooking.thedupacs.net/api/shopping-list-entry/?last_autosync=1728065537113 net::ERR_FAILED
(anonymous) @ chunk-vendors.js:347
xhr @ chunk-vendors.js:347
ke @ chunk-vendors.js:347
_request @ chunk-vendors.js:347
request @ chunk-vendors.js:347
(anonymous) @ chunk-vendors.js:347
(anonymous) @ api-chunk.js:1
(anonymous) @ api-chunk.js:1
Promise.then
listShoppingListEntrys @ api-chunk.js:1
autosync @ shopping_list_view.js:1
(anonymous) @ chunk-vendors.js:347
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1
setTimeout
autoSyncLoop @ shopping_list_view.js:1
(anonymous) @ shopping_list_view.js:1Understand this error
11shopping_list_view.js:1 running autosync

@jmawet
Copy link
Author

jmawet commented Oct 4, 2024

Although if I check from other devices, the items did get checked off. So some amount of syncing must be working. I'll update if the items get added back to the shopping list (they usually do)

@vabene1111
Copy link
Collaborator

interesting, I do not see any immediate error so this will likely be some kind of logical issue. I am sorry but given my time constraints I will have to refer you to the new version once that is out at some point. There I will have to rewrite the sync logic anyway and will put additional effort into avoiding sync conflicts.

see #2976

@vabene1111
Copy link
Collaborator

so I thought about this a bit more when working on the new shopping list and noticed that the timestamps used to filter the results that are fetched are generated on the client. Is it possible that your server time and client times differ to some degree (even a few seconds might suffice).

If so, if you want to help debug this, feel free to sync the clocks on your server and your clients (by just doing an ntp update on both) and see if your issue is resolved.

For the new implementation I will need to find a way to be Independent of the client time, I have some ideas for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants