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

Cannot view all items #1089

Closed
tuur29 opened this issue Feb 10, 2019 · 10 comments
Closed

Cannot view all items #1089

tuur29 opened this issue Feb 10, 2019 · 10 comments

Comments

@tuur29
Copy link

tuur29 commented Feb 10, 2019

#1014 added the functionality to work offline and it's great.

However I can no longer access my old read items. I can see the amount of items next to the newest menu item (16/1641) and see those 16 items loaded after the upgrade, more are downloaded when I refresh my sources. But I cannot see all (non-offline) items. They do show when searching.

This problem might be limited to my fork, but the intended functionality isn't clear to me which makes this very hard to debug. Should the application be downloading them in the background or load them when I view /newest/all or am I missing something else?

@niol
Copy link
Collaborator

niol commented Feb 10, 2019

As a workaround, you can always disable offline by logging out.
Regarding items that are not in the offline db, selfoss should know when items are to be found online only. It should switch from querying the offline db to requesting /?offset... on the server automatically.
The intent is to have unread and starred items available offline, and then cleanup items older by 10 days, not unread, not starred. Maybe there's a bug somewhere, but I've tested this numerous times.

When you say that you cannot access your old read items, is it that the "more" button does not show?

@tuur29
Copy link
Author

tuur29 commented Feb 10, 2019

Aah then it's working as intended. It's only syncing items from the last 10 days + unread and starred. Is there a reason why you don't just sync all items?

I can access them in normal mode just fine, thanks.

@niol
Copy link
Collaborator

niol commented Feb 11, 2019

Syncing all items is too much for offline storage (especially on mobile devices), given that users may have a large number of items.
Regarding accessing old read items, let me repeat myself: you should not have to log out and log in again without offline storage to read them. If that's the case, there's a bug I need to look into: selfoss should switch from querying the offline db to requesting on the server automatically.

@tuur29
Copy link
Author

tuur29 commented Feb 11, 2019

Alright.
I looked around for a possible cause and found my problem happens after reloading the page with devtools opened and the "disable cache" flag enabled on the network tab. Once I do this, the only way to fix it is to login again.
I've tested this on master and the problem pops up there as well.

@niol
Copy link
Collaborator

niol commented Feb 11, 2019

Opening devtools and disabling cache should not modify the behaviour. When you say that you cannot access your old read items, is it that the "more" button does not show?

@tuur29
Copy link
Author

tuur29 commented Feb 11, 2019

That is correct. I have auto_stream_more enabled with items_perpage=50 with 40 items synced. Changing either of these settings have no effect on the problem. After loading 40 items the more buttons doesn't show.

@niol
Copy link
Collaborator

niol commented Feb 11, 2019

I'll look into this. Maybe auto_stream_more enabled or items_perpage > items synced is causing problems.

@niol
Copy link
Collaborator

niol commented Feb 17, 2019

OK this was a problem with items_perpage > items synced, the following should fix this:

--- a/public/js/selfoss-db.js
+++ b/public/js/selfoss-db.js
@@ -594,7 +594,7 @@ selfoss.dbOffline = {
                     }
 
 
-                    if (seek && !ascOrder && !alwaysInDb
+                    if (!ascOrder && !alwaysInDb
                     && entry.datetime < selfoss.dbOffline.newestGCedEntry) {
                         // the offline db is missing older entries, the next
                         // seek will have to find them online.

Does that work for you?

@tuur29
Copy link
Author

tuur29 commented Feb 17, 2019

Ah yes, that fixed it. Thanks!

@niol
Copy link
Collaborator

niol commented Feb 21, 2019

fixed in dec4c4f

@niol niol closed this as completed Feb 21, 2019
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