pmartin / plop-reader

A Wallabag application for Pocketbook / TEA Touch Lux ereaders
http://plop-reader.pascal-martin.fr
GNU General Public License v3.0
41 stars 6 forks source link

Sync entries from device to server -> timezone #105

Open Pofilo opened 4 years ago

Pofilo commented 4 years ago

Hello, I'm using the last version of plop-reader with the last version of wallabag on a Touch HD Plus. The function wallabag_api.syncEntriesToServer() is not doing anything to the server (not telling the server that an article is now marked as read). Is someone else experiencing the issue ?

In the logs, I juste have:

[2020:02:11 22:09:21][debug] API: syncEntriesToServer()
[2020:02:11 22:09:21][debug] API: syncEntriesToServer(): done

It seems that we never enter in the loop for (unsigned int i=0 ; i<changedEntries.size() ; i++) {. Maybe because of the function repository.findUpdatedLocallyMoreRecentlyThanRemotely(changedEntries); ?

If someone else is experiencing the issue, let me know :) I will try to find an explanation why the changedEntries are not correctly updated.

Pofilo commented 4 years ago

Okay, I may have found my issue.

In the database, local_updated_at > remote_updated_at was not true because of timezones: my server is in CET timezone whereas the pocketbook (or plop reader) is in UTC/GMT.

I will provide a PR if I manage to deal properly with timezones. Otherwise, I this is not a big deal if I'm patient between operations on the server and the pocketbook (at least one hour in winter).