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

Introduce SearchState and clean up SearchMoviesVC #144

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

fbernutz
Copy link
Member

Description

This is a preparation for #138 and introduces a SearchState and cleans up SearchMovieViewController

struct SearchState: Equatable {
var selectedGenres: [Genre] = []
var searchQuery: String = ""
var currentPage: Int = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a very subtle bug that I can't figure out right now.
Here are steps to reproduce:

  1. Enter the search tab. The "Discover Movies" List is being displayed. When you scroll to the bottom, the last movie currently is "Important Police Shit", which is on page 3.
  2. Re-run the app and search for something that has more than 3 pages (a single letter is usually good)
  3. Scroll down until you reach a page greater than 3.
  4. Delete the search term
  5. Scroll down.

Expected: Page 3 is loaded and the last movie is the same as before (e.g. "Important Police Shit")

Actual: Page 3 is never loaded.

My intuition here is that because currentPage and totalResults is shared between the search and discover request, there is some sort of problem. I have to sleep on it.

CineasteTests/SearchReducerTests.swift Show resolved Hide resolved
@xavierLowmiller xavierLowmiller merged commit 38d68c7 into master Jul 1, 2020
@fbernutz fbernutz deleted the search-reswift branch July 1, 2020 18:48
@fbernutz fbernutz mentioned this pull request Jul 1, 2020
14 tasks
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.

2 participants