Coder Social home page Coder Social logo

Comments (6)

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

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a πŸ‘ reaction on the request. This helps us prioritize new features most important to you. Thank you!

from amplify-swift.

lawmicha avatar lawmicha commented on June 3, 2024

Thank you for raising the feature request. Our team will prioritize it and will post an update on the issue once we have more information.

from amplify-swift.

madej10 avatar madej10 commented on June 3, 2024

Hi @lawmicha any update on this? we're seeing #3437 a lot too so we would be very interested in this feature

from amplify-swift.

fzy-spyro avatar fzy-spyro commented on June 3, 2024

@lawmicha I am experimenting with BackgroundTasks on iOS in order to trigger DataStore syncing to cloud and have a question.

I am trying a naive approach that will "simply" call DataStore.stop() followed by DataStore.start() methods and will observe outboxStatus event until it reaches empty: true state.

So far I have observed that I am able to call start/stop methods but I am unable to receive outbox events. Is there any code in DataStore which might prevent it running when app is in background state?

from amplify-swift.

lawmicha avatar lawmicha commented on June 3, 2024

Hi @fzy-spyro, there isn't anything in DataStore that I'm aware of that depends on the background/foreground state of the app. I wonder what the start sequence logs look like when you call start() from the background task, perhaps it's not emitting the event because it didn't sync the mutation? Do you see any other events emitted? the events are sent through the Hub category in Amplify.

from amplify-swift.

lawmicha avatar lawmicha commented on June 3, 2024

@madej10 / @kubatatami DataStore currently does not have any special implementation that checks the app states to see whether it's in foreground or background, I think the path forward in this feature request are one or a combination of:

  1. DataStore to own the implementations of the background tasks that will execute in the background. This may or may not be opt-in, such that the developers may have to enable background mode of some sort for DataStore to utilize this behavior.

  2. DataStore to provide APIs which are to be called during background task execution, the developer writes the background tasks and as part of the code, call into something like DataStore.performBackgroundSync() , where the API is a slim down version of the DataStore sync sequence (probably wouldn't have to estasblish the subscriptions for example).

A note about batching, DataStore calls AppSync APIs create/update/delete, so batching may be difficult because the AppSync API to perform batch mutations simply doesn't exist. If AppSync does provide a batch API, we may be able to reconcile the entire pages pretty quickly, as we do with the full/delta sync response which is also a page of model data.

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.