This repository was archived by the owner on Feb 8, 2022. It is now read-only.
Fixed issue where item wasn't moved to new section.#81
Open
jallen wants to merge 24 commits intopolqf:masterfrom
Open
Fixed issue where item wasn't moved to new section.#81jallen wants to merge 24 commits intopolqf:masterfrom
jallen wants to merge 24 commits intopolqf:masterfrom
Conversation
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 |
Owner
There was a problem hiding this comment.
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
Owner
|
Thanks for the PR @jallen 😄 |
Use array filter instead of predicate to limit initial set of tasks to be contained in one section using "resolved" sectionKeyPath.
Author
|
I see where my test went wrong. I'm now just filtering the initial set of objects. Also, maybe an initResolvedWithKeyPath method would be cleaner? Let me know what you think. |
This reverts commit 9a6156d.
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.
Use array filter instead of predicate to limit initial set of tasks to be contained in one section using "resolved" sectionKeyPath.
…Controller into bug/new-section-move # Conflicts: # Example/RealmResultsController-iOSTests/RealmResultsCacheTests.swift # Source/RealmResultsCache.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 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
👻 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.