@jcbuisson/express-x-client 3.1.15 → 3.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/client.mts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x-client",
3
- "version": "3.1.15",
3
+ "version": "3.1.16",
4
4
  "type": "module",
5
5
  "description": "Client library for ExpressX framework",
6
6
  "main": "src/client.mts",
package/src/client.mts CHANGED
@@ -304,6 +304,8 @@ export function offlinePlugin(app) {
304
304
  .then(result => applyUpdateAcknowledgement(uid, now, result))
305
305
  .catch(async err => {
306
306
  console.log(`*** err sync ${modelName} update`, err)
307
+ const currentMetadata = await db.metadata.get(uid)
308
+ if (!currentMetadata || !sameTimestamp(currentMetadata.updated_at, now)) return
307
309
  // rollback
308
310
  delete previousValue.uid
309
311
  await db.values.update(uid, previousValue)