Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Set up cache for items in the search result #339

Merged
merged 1 commit into from Jul 19, 2016

Conversation

ahitrin
Copy link
Contributor

@ahitrin ahitrin commented Jul 19, 2016

The original attempt to fix the bug with read/unread status (#137) was quite far from the good solution, so I've decided to rewrite it from scratch.

I'm looking forward for feedback, especially on the test. I had very little C++ practice during several past years so there might be stupid errors in the code.

RSS items from the search result are created with no reference to the
cache instance. This causes missing of item read/unread status. The bug
is easy to reproduce:

 * load a feed with some items
 * start a new search that finds one or several items
 * read any item from the search result
 * quit search
 * run the same search again

Expected result: already read items should NOT be marked as "unread".

In this commit we deliberately assign a reference to the cache instance
for all RSS items found in the database, the same way it's done in the
`cache::internalize_rssfeed` method. A new unit test provides steps to
reproduce behavior described above, so we can be sure that the bug is
really fixed.
@coveralls
Copy link

coveralls commented Jul 19, 2016

Coverage Status

Coverage increased (+0.4%) to 28.251% when pulling bc5c2ef on ahitrin:search-new-fix into b7cb95e on akrennmair:master.

@Minoru Minoru merged commit 30882c1 into akrennmair:master Jul 19, 2016
@Minoru
Copy link
Collaborator

Minoru commented Jul 19, 2016

The code looks perfectly fine to me. Thank you!

@Minoru Minoru added this to the 2.10 milestone Jul 19, 2016
@ahitrin ahitrin deleted the search-new-fix branch July 20, 2016 06:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants