Giter Site home page Giter Site logo

Comments (8)

shaps80 avatar shaps80 commented on June 2, 2024

@JosephDuffy

from composed.

JosephDuffy avatar JosephDuffy commented on June 2, 2024

I'm all for this. I see the problem it's fixing and can see how it would be a problem. But I'm wondering exactly how this works.

Is there a method in Core Data to say "stop sending me updates"? If you perform the move while in this stopped state does it map the index paths of the changes performed during the move to what they should be after the move?

If I had:

  • A
  • B
  • C

then I pick up C and move (but don't drop) it:

  • A
  • (C)
  • B

While it's in the this dragging state there's an insert of BB after B. Do I see:

  • A
  • (C)
  • B
  • BB

or

  • A
  • (C)
  • B

?

Once dropped I should see the first.

At the time of the insert – from the perspective of the data source – it was inserted at index 2, but after the drop it would be index 3. If it's not inserting during the drop, does Core Data map to the correct index (2), or does Composed need to do this?

from composed.

shaps80 avatar shaps80 commented on June 2, 2024

Interesting thought. So when using NSFetchedResultsController you get the following:

willChange
didChangeSection
didChangeItem
didChange

So generally you add a flag via suspend() or wateva and essentially ignore updates to the UI from CoreData during the move.

On drop, you just need to update the model. The actual UI updates are not necessary (hence why you need to pause).

After the drop, you call resume() and everything returns to normal.


Now what you're asking is what happens if an update occurs in the background for example during the move?

I've never actually encountered this but I would imagine this would cause a problem. I would imagine UI updates would be missed for those background updates, so the result would be (incorrectly) A C B.

How do you think we could handle this scenario?

I think this would have to be handled by each section that supports Suspendible. When updates received during a suspended state, would need to be cached and re-applied on resume().

The issue would be that you'd need to ignore the update for the move, since that's the whole point of the suspension.

I think a diff library would best handle this since it would essentially just be comparing snapshots before and after at any stage.

from composed.

shaps80 avatar shaps80 commented on June 2, 2024

Given the performance stuff you've uncovered as of late, I'm reluctant to continue with this ticket. Close JosephDuffy ?

from composed.

JosephDuffy avatar JosephDuffy commented on June 2, 2024

I was thinking about this while working on #18; the changes in that PR might helps this.

Between that and the performance improvements these things are more feasible.

Focussing on the quality of the existing features is my main priority, but I don't think that means we need to close this, unless you don't plan to implement it for a while.

EDIT: Just fixed the link above.

from composed.

shaps80 avatar shaps80 commented on June 2, 2024

I was thinking about this while working on #18; the changes in that PR might helps this.

Not sure how that PR is directly associated, would be keen to hear your thoughts, but not a priority?

Focussing on the quality of the existing features is my main priority, but I don't think that means we need to close this, unless you don't plan to implement it for a while.

Yeah my thinking was that this isn't really a 'requirement' as much as I expected it to be. So it might be a while or never even make it in. So cleaning up the issue made sense?

If you really want to keep it open, that's fine, otherwise I think we could close this to keep focus.

from composed.

JosephDuffy avatar JosephDuffy commented on June 2, 2024

I was thinking about this while working on #18; the changes in that PR might helps this.

Not sure how that PR is directly associated, would be keen to hear your thoughts, but not a priority?

I meant composed-swift/ComposedUI#15; the suspend and resume calls could use mappingWillBeginUpdating/mappingWillBeginUpdating, since that'll essentially ignore updates (from the UI's perspective)

Focussing on the quality of the existing features is my main priority, but I don't think that means we need to close this, unless you don't plan to implement it for a while.

Yeah my thinking was that this isn't really a 'requirement' as much as I expected it to be. So it might be a while or never even make it in. So cleaning up the issue made sense?

If you really want to keep it open, that's fine, otherwise I think we could close this to keep focus.

Go ahead and close for now, but it's worth revisiting in case it helps and composed-swift/ComposedUI#15 helps.

from composed.

shaps80 avatar shaps80 commented on June 2, 2024

👍

from composed.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.