Comments (13)
Update: 50K look good as well ✅
from differencekit.
I found another sequence that does not produce the correct results:
StagedChangeset(source: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], target: ["5", "1", "7", "4", "2", "10"])
If this gets applied via AppKit extension tableView.reload
, the result is as follow:
Should be: ["5", "1", "7", "4", "2", "10"]
But is: ["5", "1", "2", "7", "4", "10"]
from differencekit.
I dont think any of the unit tests will capture this, as none of them check what the actual state is that AppKit ends up in. Any advice how this could be fixed?
Unfortunately, this is a serious issue and produces wrong results in some scenarios.
from differencekit.
I added some code that compares data vs AppKit state and demonstrates the mentioned error sequence:
from differencekit.
Any resolution on this as I'm seeing the same issue in the Appkit extension.
from differencekit.
I actually am not quite familiar with AppKit and the AppKit extension was added by another developer in this PR. So I won't give you any good resolution on the issue but if the proposed way works in any cases including edge cases and it's proved somehow, I would accept it to merge.
from differencekit.
The only working solution that I could find in the whole internet that is working reliably for AppKit was written by @GilesHammond and a version of it can be found here: paxos/NSOutlineViewPatchTestSuite#1
We added a test suite with randomized tests to verify this, and so far it has been working flawlessly.
from differencekit.
Interesting. It must be worth trying to incorporate into DifferenceKit if it really did pass 50k randomized test cases. Can you create a PR for it?
from differencekit.
I am not sure. The solution is based on native Swift CollectionDifference.
I believe the steps returned by DifferenceKit are not 100% compatible with the Sequence that AppKit expects each step to get applied.
from differencekit.
Can anyone run the 50k randomized test cases for my PR #144? Would be really great as I haven't found the time yet to implement some tests for my proposed solution.
from differencekit.
@tobiasjordan I have updated the testsuite to use differencekit here:
https://github.com/paxos/NSOutlineViewPatchTestSuite/tree/use-differencekit
Your fix is used starting in 6a31c8ab9dfa3f0d84e90653ba6906bd8345cc19 and so far it looks promising. 10K run successfully, 50K is still running.
from differencekit.
from differencekit.
Sorry Patrick. I’ve been slack on sharing this as a package! Would that be helpful in this case? Giles
…
On 27 May 2022, at 19:28, Patrick Dinger @.***> wrote: I am not sure. The solution is based on native Swift CollectionDifference. I believe the steps returned by DifferenceKit are not 100% compatible with the Sequence that AppKit expects each step to get applied. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
no worries, i am good for now! thanks
from differencekit.
Related Issues (20)
- Compute changeset in the background
- To do the insert and delete operations at once
- Delete .swift-version
- Crash when I reload collectionView HOT 1
- Help needed with crash - NSInternalInconsistencyException HOT 1
- Buggy default reload method HOT 1
- How can I reload a table that is behind on the navigation stack? HOT 1
- UICollectionView reload animation
- Why DifferenceKit is so much faster than Apple's Foundation diffing? HOT 2
- Animation option for row reloading is not a valid option in AppKitExtension
- Does it work seamlessly when using an UICollectionView with SwiftUI cells? HOT 2
- tvOS UICollectionView.reload crash
- The algorithm cannot get the best diff results? HOT 1
- `Differentiable` requres `Equatable` AND `Hashable`, but docs say otherwise
- Using only the diffing algorithm
- Invalid batch updates detected
- How to apply ChageSet to an array?
- Use UITableView reconfigureRows and UICollectionView reconfigureItems for ChangeSet.elementUpdated
- How to use DifferenceKit with diffable data sources? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from differencekit.