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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.2 -- (hotfix): merge persisted mangas with fetched ones #25

Merged
merged 2 commits into from
Nov 23, 2019

Conversation

agilgur5
Copy link
Owner

@agilgur5 agilgur5 commented Nov 23, 2019

  • previously fetched mangas would just overwrite the existing mangas

    • now that we have important data like chapter read/unread & new
      tracking, we can't just overwrite, have to merge them together
  • this is a bit of an edge case as the only time there's a conflict is
    when a favorited manga also appears in the Latest or Search list

    • but it certainly does happen, I just experienced it!
      • had chapters overwritten to an empty list bc manga was in Latest

The merge logic here is similar to that used in #23 -- running into similar merging issues in a few places 馃槄 Should really write some tests eventually, at least for the store, with some fake data to test for all these persistence edge cases

- previously fetched mangas would just overwrite the existing mangas
  - now that we have important data like chapter read/unread & new
    tracking, we can't just overwrite, have to merge them together

- this is a bit of an edge case as the only time there's a conflict is
  when a favorited manga also appears in the Latest or Search list
  - but it certainly does happen, I just experienced it!
    - had chapters overwritten to an empty list bc manga was in Latest
- fixes edge case when persisted favorited manga is overwritten by a
  fetch of the same manga in latest or search
Copy link
Owner Author

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not much to review, looks good and is tested -- publish the hotfix!

@agilgur5 agilgur5 merged commit 77d87f1 into master Nov 23, 2019
@agilgur5 agilgur5 deleted the merge-mangas branch November 23, 2019 00:09
@agilgur5 agilgur5 changed the title (hotfix): merge persisted mangas with fetched ones v0.2.2 -- (hotfix): merge persisted mangas with fetched ones Nov 23, 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

Successfully merging this pull request may close these issues.

None yet

1 participant