repowise 0.1.58 → 0.1.60
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/dist/bin/repowise.js +14 -5
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -430,6 +430,10 @@ function decodeEmailFromIdToken(idToken) {
|
|
|
430
430
|
async function processNotifications(notifications, state, repoLocalPaths, apiUrl) {
|
|
431
431
|
let updateCount = 0;
|
|
432
432
|
for (const notif of notifications) {
|
|
433
|
+
const repoState = state.repos[notif.repoId];
|
|
434
|
+
if (repoState && notif.createdAt <= repoState.lastSyncTimestamp) {
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
433
437
|
if (notif.type === "sync.completed") {
|
|
434
438
|
const localPath = repoLocalPaths.get(notif.repoId);
|
|
435
439
|
if (localPath) {
|
|
@@ -493,9 +497,14 @@ async function startListener(options) {
|
|
|
493
497
|
const origLog = console.log.bind(console);
|
|
494
498
|
const origError = console.error.bind(console);
|
|
495
499
|
const origWarn = console.warn.bind(console);
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
500
|
+
const ts = () => {
|
|
501
|
+
const d = /* @__PURE__ */ new Date();
|
|
502
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
503
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
|
504
|
+
};
|
|
505
|
+
console.log = (...args) => origLog(`[${ts()}]`, ...args);
|
|
506
|
+
console.error = (...args) => origError(`[${ts()}]`, ...args);
|
|
507
|
+
console.warn = (...args) => origWarn(`[${ts()}]`, ...args);
|
|
499
508
|
running = true;
|
|
500
509
|
if (!options?.skipPidCheck) {
|
|
501
510
|
const alreadyRunning = await handleStalePid();
|
|
@@ -565,8 +574,8 @@ async function startListener(options) {
|
|
|
565
574
|
}
|
|
566
575
|
try {
|
|
567
576
|
const sinceTimestamp = group.repoIds.reduce((earliest, id) => {
|
|
568
|
-
const
|
|
569
|
-
return
|
|
577
|
+
const ts2 = state.repos[id]?.lastSyncTimestamp ?? now;
|
|
578
|
+
return ts2 < earliest ? ts2 : earliest;
|
|
570
579
|
}, now);
|
|
571
580
|
const response = await group.pollClient.poll(group.repoIds, sinceTimestamp);
|
|
572
581
|
if (group.offline.isOffline) {
|