@dboio/cli 0.11.3 → 0.11.4
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.
- package/package.json +1 -1
- package/src/lib/client.js +4 -7
- package/src/lib/toe-stepping.js +17 -2
package/package.json
CHANGED
package/src/lib/client.js
CHANGED
|
@@ -124,15 +124,12 @@ export class DboClient {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
127
|
+
* No-op placeholder. Server-side cache voiding (/?voidcache=true) has been
|
|
128
|
+
* disabled as it was causing server issues. Callers remain unchanged so the
|
|
129
|
+
* hook can be re-enabled later if needed.
|
|
129
130
|
*/
|
|
130
131
|
async voidCache() {
|
|
131
|
-
|
|
132
|
-
const baseUrl = await this.getBaseUrl();
|
|
133
|
-
if (this.verbose) log.verbose(`VoidCache: ${baseUrl}/?voidcache=true`);
|
|
134
|
-
await this.request('/?voidcache=true');
|
|
135
|
-
} catch { /* best-effort — don't block on failure */ }
|
|
132
|
+
// intentionally empty
|
|
136
133
|
}
|
|
137
134
|
|
|
138
135
|
/**
|
package/src/lib/toe-stepping.js
CHANGED
|
@@ -14,6 +14,14 @@ import { log } from './logger.js';
|
|
|
14
14
|
*/
|
|
15
15
|
const DIFF_ALLOW = new Set(['_LastUpdated', '_LastUpdatedUserID']);
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Metadata-only columns that don't represent real user edits.
|
|
19
|
+
* When the server diff contains ONLY these columns, the conflict is
|
|
20
|
+
* considered a timestamp-only change and is silently resolved by accepting
|
|
21
|
+
* the server values without prompting the user.
|
|
22
|
+
*/
|
|
23
|
+
const METADATA_ONLY_COLS = new Set(['_LastUpdated', '_LastUpdatedUserID', '_children']);
|
|
24
|
+
|
|
17
25
|
/**
|
|
18
26
|
* Fetch a single record from the server by entity name + row UID.
|
|
19
27
|
*
|
|
@@ -348,12 +356,19 @@ export async function checkToeStepping(records, client, baseline, options, appSh
|
|
|
348
356
|
if (isNaN(serverDate) || isNaN(baselineDate)) continue; // unparseable — skip
|
|
349
357
|
if (serverDate <= baselineDate) continue; // server is same or older — no conflict
|
|
350
358
|
|
|
351
|
-
hasConflicts = true;
|
|
352
|
-
|
|
353
359
|
// Conflict detected: server changed since our baseline
|
|
354
360
|
const metaDir = dirname(metaPath);
|
|
355
361
|
const label = basename(metaPath, '.metadata.json');
|
|
356
362
|
const diffColumns = await buildRecordDiff(serverEntry, baselineEntry, meta, metaDir);
|
|
363
|
+
|
|
364
|
+
// If the only server-side changes are metadata columns (_LastUpdated,
|
|
365
|
+
// _LastUpdatedUserID) with no real data edits, silently accept the
|
|
366
|
+
// server timestamps — no conflict to resolve.
|
|
367
|
+
const realChanges = diffColumns.filter(d => !METADATA_ONLY_COLS.has(d.col));
|
|
368
|
+
if (realChanges.length === 0) continue;
|
|
369
|
+
|
|
370
|
+
hasConflicts = true;
|
|
371
|
+
|
|
357
372
|
const serverUser = serverEntry._LastUpdatedUserID || 'unknown';
|
|
358
373
|
|
|
359
374
|
displayConflict(label, serverUser, serverTs, diffColumns);
|