Giter Site home page Giter Site logo

Comments (4)

dfahlander avatar dfahlander commented on September 7, 2024

The level param will only order the middleware differently to be called before or after other middlewares. There is no way to generically jump over another middleware since the down-level (or next) middleware has to be called to eventually reach the lowest level.

The sync engine does not origin from within a middleware. Middleware is there to track mutations and other things though. But I think you should be able to detect whether an operation was initiated by the user or from a sync operation. If trans.disableChangeTracking is true (that property is not typed so you'd have to // @ts-ignore it), it means that all the operations being performed are results from a sync operation and not locally performed.

from dexie.js.

tylermercer avatar tylermercer commented on September 7, 2024

If trans.disableChangeTracking is true (that property is not typed so you'd have to // @ts-ignore it), it means that all the operations being performed are results from a sync operation and not locally performed.

Neat! I was wondering if such a property existed but didn't notice that one.

I tried that just now and it seems to work, except for a case that I can't seem to reproduce, which I saw right at the beginning of my testing, where that property was falsy for an insertion that originated from dexie-cloud-addon.

Are there any cases where an entity is added by the dexie-cloud-addon but it doesn't set disabledChangeTracking to true? 🤔

from dexie.js.

dfahlander avatar dfahlander commented on September 7, 2024

Are there any cases where an entity is added by the dexie-cloud-addon but it doesn't set disabledChangeTracking to true? 🤔

Yes when storing dexie-cloud data in tables starting with $ in their name ($logins, $baserevs etc), then it does not need to set this property because those tables aren't tracked. But any change in synced application defined tables shall for sure have this property set when being updated.

from dexie.js.

tylermercer avatar tylermercer commented on September 7, 2024

That makes sense! Thanks for your help.

from dexie.js.

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.