Coder Social home page Coder Social logo

Comments (11)

ruisebas avatar ruisebas commented on June 12, 2024

Hi @kubatatami, thanks for opening this issue.

The team will take a look and post here once we have an update.

from amplify-swift.

5d avatar 5d commented on June 12, 2024

Hi @kubatatami,
For the expected behavior, when stop and start to re-evaluate the new predicate expression, do you want to keep the old data which is evaluated by the previous predicate expression?

from amplify-swift.

kubatatami avatar kubatatami commented on June 12, 2024

@5d Yes. Let's say we have a user with data from the last few months. User signs in and I want to let him use the app once the app synced data from the last 24h. Then I want to re-evaluate expressions to sync rest of data.

from amplify-swift.

5d avatar 5d commented on June 12, 2024

@kubatatami Thanks for confirming. Therefore, the desired behavior is to preserve the data filtered by the previous predicate and apply the new predicate exclusively to the newly generated data upon triggering a restart on the datastore.

from amplify-swift.

kubatatami avatar kubatatami commented on June 12, 2024

@5d @ruisebas I was also thinking about different strategy to observe syncing progress and let users use the app once the app synced data from the last 24h but I noticed that query Sync[tableName] requests(made internally by Amplify sdk) always returns data in pages from oldest to newest. Is there any way to change it on local or backend side and syncing data from newest to oldest?

from amplify-swift.

lawmicha avatar lawmicha commented on June 12, 2024

Please try out the fix in lawmicha.ds-full-sync-expression-change #2757 and let us know if you are able to successfully change your sync expression and restart DataStore to do a full sync

from amplify-swift.

kubatatami avatar kubatatami commented on June 12, 2024

Hey @lawmicha fix in lawmicha.ds-full-sync-expression-change looks good. I am able to successfully change sync expression and restart DataStore to do a full sync. We continue tests but so far it looks very promising. Thanks 🙏

from amplify-swift.

lawmicha avatar lawmicha commented on June 12, 2024

Hi @kubatatami, thanks for trying out the fix and letting us know.

Is there any way to change it on local or backend side and syncing data from newest to oldest?

We don't expose a way to change the sort order for the Sync Query API call performed internally but that sounds like it might be possible and would not impact the integrity of the data. What are some use cases you have in mind for sorting by newest to oldest? Is it so that you will display the most recently created/updated items first and let the oldest items eventually come in?

from amplify-swift.

kubatatami avatar kubatatami commented on June 12, 2024

@lawmicha Yes, exactly. Now on lawmicha.ds-full-sync-expression-change we are able to sync last X days of data, let user to use the app and then we re-evaluate expressions to sync all of data in the background. It works ok but if we would be able to change the sort order for the Sync Query API we would be able to observe sync progress and let user to use the app when we synced last X days of data. This way we would not have to pull data for last X days twice and older data would be available in the app from newest to oldest what in most cases is more important for user.

from amplify-swift.

lawmicha avatar lawmicha commented on June 12, 2024

This has been released in https://github.com/aws-amplify/amplify-swift/releases/tag/2.25.1

from amplify-swift.

github-actions avatar github-actions commented on June 12, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

from amplify-swift.

Related Issues (20)

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.