ework-web 0.10.124 → 0.10.125

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": "ework-web",
3
- "version": "0.10.124",
3
+ "version": "0.10.125",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "start": "bun src/index.ts",
43
43
  "check": "tsc --noEmit",
44
44
  "typecheck": "tsc --noEmit",
45
- "test": "bun test",
45
+ "test": "bun test --timeout=30000",
46
46
  "test:mysql": "bash scripts/test-mysql.sh"
47
47
  },
48
48
  "dependencies": {
@@ -56,7 +56,7 @@
56
56
  "zod": "^3.23.8"
57
57
  },
58
58
  "devDependencies": {
59
- "@types/bun": "latest",
59
+ "@types/bun": "1.4.2",
60
60
  "@types/jsdom": "^28.0.3",
61
61
  "typescript": "^5.6.0"
62
62
  }
package/src/db.ts CHANGED
@@ -151,6 +151,9 @@ function migrateCommentsTable(db: Database): void {
151
151
  if (!have.has("model")) {
152
152
  db.exec(applyPrefix("ALTER TABLE {{comments}} ADD COLUMN model TEXT NOT NULL DEFAULT ''"));
153
153
  }
154
+ if (!have.has("runtime")) {
155
+ db.exec(applyPrefix("ALTER TABLE {{comments}} ADD COLUMN runtime TEXT NOT NULL DEFAULT ''"));
156
+ }
154
157
  }
155
158
 
156
159
  function migrateLabelsTable(db: Database): void {
@@ -397,6 +400,7 @@ async function migrateMysqlIssuesAiStatus(pool: Pool): Promise<void> {
397
400
  await migrateMysqlColumn(pool, "issues", "runtime", "runtime VARCHAR(32) NOT NULL DEFAULT ''");
398
401
  await migrateMysqlColumn(pool, "issues", "upstream_issue_number", "upstream_issue_number INT DEFAULT NULL");
399
402
  await migrateMysqlColumn(pool, "comments", "model", "model VARCHAR(128) NOT NULL DEFAULT ''");
403
+ await migrateMysqlColumn(pool, "comments", "runtime", "runtime VARCHAR(32) NOT NULL DEFAULT ''");
400
404
  await migrateMysqlColumn(pool, "comments", "upstream_comment_id", "upstream_comment_id BIGINT DEFAULT NULL");
401
405
  const indexes: Array<[string, string]> = [
402
406
  ["uq_issues_project_upstream", applyPrefix("CREATE UNIQUE INDEX uq_issues_project_upstream ON {{issues}} (project_id, upstream_issue_number)")],
@@ -80,6 +80,7 @@ CREATE TABLE IF NOT EXISTS {{comments}} (
80
80
  CONSTRAINT {{fk_comments_issue}} FOREIGN KEY (issue_id) REFERENCES {{issues}}(id) ON DELETE CASCADE,
81
81
  CONSTRAINT {{fk_comments_author}} FOREIGN KEY (author) REFERENCES {{users}}(login),
82
82
  model VARCHAR(128) NOT NULL DEFAULT ''
83
+ ,runtime VARCHAR(32) NOT NULL DEFAULT ''
83
84
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
84
85
  CREATE INDEX comments_issue_created ON {{comments}} (issue_id, created_at);
85
86
  CREATE INDEX comments_author ON {{comments}} (author);
package/src/webhooks.ts CHANGED
@@ -105,6 +105,15 @@ function releaseDeliverySlot(): void {
105
105
  if (next) next();
106
106
  }
107
107
 
108
+ /** Await webhook delivery quiescence (tests/ops); throws after timeoutMs. */
109
+ export async function waitForWebhookQueueIdle(timeoutMs = 5_000): Promise<void> {
110
+ const deadline = Date.now() + timeoutMs;
111
+ while (inFlightDeliveries > 0 || deliveryQueue.length > 0) {
112
+ if (Date.now() >= deadline) throw new Error("waitForWebhookQueueIdle: timeout");
113
+ await Bun.sleep(10);
114
+ }
115
+ }
116
+
108
117
  function now(): string {
109
118
  return new Date().toISOString();
110
119
  }