Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

Conversation

@jallen
Copy link

@jallen jallen commented Jun 20, 2016

🎩 What? Why?

If an item is moved to a new section and the section doesn't exist the item is Inserted instead of moved causing the section in the tableView to not be displayed.

👪 Dependencies?

📋 Developer checklist

  • Documentation
  • Unit Tests
  • Update README (if necessary)

👻 GIF


If the section didn't exist before the item was moved the updated item would be inserted instead of moved causing the new section to not be displayed properly in the tableView.

If the section didn't exist before the item was moved the updated item would be inserted instead of moved causing the new section to not be displayed properly in the tableView.
type = cache.updateType(task)
}
it("returns type .Move") {
expect(type) == RealmCacheUpdateType.Move
Copy link
Owner

Choose a reason for hiding this comment

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

I think in this case the desired test to have is if a nonResolvedTask resolved flag changes to true, it should return a .Move. In this concrete case it should return a deletion, as the predicate of the request is saying that it only "allows" tasks that have resolved == true, and this is not the case

@polqf
Copy link
Owner

polqf commented Jun 27, 2016

Thanks for the PR @jallen 😄
Take a look at the comment I put, and sorry for the delay, I've been really busy the past days

Use array filter instead of predicate to limit initial set of tasks to be contained in one section using "resolved" sectionKeyPath.
@jallen
Copy link
Author

jallen commented Jun 28, 2016

I see where my test went wrong.

I'm now just filtering the initial set of objects.
As far as I can tell this doesn't interfere with the request.

Also, maybe an initResolvedWithKeyPath method would be cleaner?

Let me know what you think.

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.

2 participants