idea-manager 1.1.6 → 1.1.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-manager",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Turn free-form brainstorming into structured task trees with AI-generated prompts. Built-in MCP Server for autonomous AI agent execution. Local-first with SQLite, cross-PC sync via Git.",
5
5
  "keywords": [
6
6
  "brainstorm",
@@ -8,7 +8,6 @@ class DatabaseWrapper {
8
8
  private db: any;
9
9
  private dbPath: string;
10
10
  private dirty = false;
11
- private saveTimer: ReturnType<typeof setTimeout> | null = null;
12
11
 
13
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
13
  constructor(db: any, dbPath: string) {
@@ -23,21 +22,8 @@ class DatabaseWrapper {
23
22
  this.dirty = false;
24
23
  }
25
24
 
26
- private scheduleSave() {
27
- this.dirty = true;
28
- if (this.saveTimer) return;
29
- this.saveTimer = setTimeout(() => {
30
- this.save();
31
- this.saveTimer = null;
32
- }, 100);
33
- }
34
-
35
25
  private immediatelySave() {
36
26
  this.dirty = true;
37
- if (this.saveTimer) {
38
- clearTimeout(this.saveTimer);
39
- this.saveTimer = null;
40
- }
41
27
  this.save();
42
28
  }
43
29
 
@@ -85,7 +71,7 @@ class DatabaseWrapper {
85
71
 
86
72
  run(...params: unknown[]) {
87
73
  self.db.run(sql, params);
88
- if (isWrite) self.scheduleSave();
74
+ if (isWrite) self.immediatelySave();
89
75
  const changes = self.db.getRowsModified();
90
76
  return { changes };
91
77
  },
@@ -95,7 +81,7 @@ class DatabaseWrapper {
95
81
  exec(sql: string) {
96
82
  this.db.exec(sql);
97
83
  if (/^\s*(INSERT|UPDATE|DELETE|CREATE|ALTER|DROP)/im.test(sql)) {
98
- this.scheduleSave();
84
+ this.immediatelySave();
99
85
  }
100
86
  }
101
87