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

get_feeds() broken when there are too many feeds with no title #203

Closed
lemon24 opened this issue Dec 4, 2020 · 0 comments
Closed

get_feeds() broken when there are too many feeds with no title #203

lemon24 opened this issue Dec 4, 2020 · 0 comments

Comments

@lemon24
Copy link
Owner

lemon24 commented Dec 4, 2020

(discovered during #196)

>>> from reader import make_reader
>>> reader = make_reader('')
>>> reader.add_feed('1')
>>> reader.add_feed('2')
>>> reader.add_feed('3')
>>> [f.url for f in reader.get_feeds()]
None
['1', '2', '3']
>>> reader._storage.chunk_size = 1
>>> [f.url for f in reader.get_feeds()]
None
['1']

This happens because the pagination adds the equivalent of WHERE kinda_title < :last_0; if any of those is null, the result is null.

if sort == 'title':
query.SELECT(("kinda_title", "lower(coalesce(user_title, title))"))
query.scrolling_window_order_by("kinda_title", "url")

The solution is likely to always coalesce to a non-null value (e.g. the empty string); we could either do it in the SELECT (if we know the value isn't used as a result), or globally in scrolling_window_order_by() (we need to see which SQLite type sorts lowest).

This is probably affecting other methods as well.

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

No branches or pull requests

1 participant