Comments (4)
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.
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.
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.
That makes sense! Thanks for your help.
from dexie.js.
Related Issues (20)
- Inconsistent sync between devices HOT 1
- Waiting for data sync before running useEffect HOT 2
- token updated, but how to get it? HOT 3
- Cloud: Conditionally prevent sync HOT 2
- Run liveQuery with a custom indexedDb [request] HOT 1
- What is expected support period for v3? (Especially for security patches) HOT 1
- Microsoft Edge Third-party cookie warning HOT 2
- Sorting and Pagination Related Issues HOT 1
- Parallelism of `toArray` within a single transaction HOT 4
- 2 samples not functional because "Typeson is not defined" HOT 3
- Cannot read properties of null (reading 'substring') HOT 3
- Cache error after bulkPut failures HOT 2
- For a custom auth integration with Dexie cloud, how does one initiate a login from a server after user info has been collected?
- db import with outdated claims throws websocket error HOT 2
- Filter AND Order / Sort? HOT 2
- Error in Dexie 4: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key HOT 1
- Add documentation of Dexie Cloud WebSocket- and sync REST endpoints
- explicit commit() HOT 1
- useLiveQuery does not update when multiple items are deleted
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 dexie.js.