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.
@@ -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
- console.log = (...args) => origLog(`[${(/* @__PURE__ */ new Date()).toISOString()}]`, ...args);
497
- console.error = (...args) => origError(`[${(/* @__PURE__ */ new Date()).toISOString()}]`, ...args);
498
- console.warn = (...args) => origWarn(`[${(/* @__PURE__ */ new Date()).toISOString()}]`, ...args);
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 ts = state.repos[id]?.lastSyncTimestamp ?? now;
569
- return ts < earliest ? ts : earliest;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repowise",
3
- "version": "0.1.58",
3
+ "version": "0.1.60",
4
4
  "type": "module",
5
5
  "description": "AI-optimized codebase context generator",
6
6
  "bin": {