@syncular/server-hono 0.0.6-165 → 0.0.6-171

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": "@syncular/server-hono",
3
- "version": "0.0.6-165",
3
+ "version": "0.0.6-171",
4
4
  "description": "Hono adapter for the Syncular server with OpenAPI support",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -63,17 +63,17 @@
63
63
  "@noble/hashes": "^2.0.1",
64
64
  "@standard-community/standard-json": "^0.3.5",
65
65
  "@standard-community/standard-openapi": "^0.2.9",
66
- "@syncular/console": "0.0.6-165",
67
- "@syncular/core": "0.0.6-165",
68
- "@syncular/server": "0.0.6-165",
66
+ "@syncular/console": "0.0.6-171",
67
+ "@syncular/core": "0.0.6-171",
68
+ "@syncular/server": "0.0.6-171",
69
69
  "@types/json-schema": "^7.0.15",
70
70
  "hono-openapi": "^1.2.0",
71
71
  "openapi-types": "^12.1.3"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@syncular/config": "0.0.0",
75
- "@syncular/dialect-pglite": "0.0.6-165",
76
- "@syncular/server-dialect-postgres": "0.0.6-165",
75
+ "@syncular/dialect-pglite": "0.0.6-171",
76
+ "@syncular/server-dialect-postgres": "0.0.6-171",
77
77
  "kysely": "*",
78
78
  "zod": "*"
79
79
  },
@@ -133,6 +133,19 @@ describe('createSyncRoutes maintenance automation', () => {
133
133
  expect(response.status).toBe(200);
134
134
  }
135
135
 
136
+ async function triggerMaintenance(
137
+ app: Hono,
138
+ clientId: string
139
+ ): Promise<void> {
140
+ // Trigger multiple pull rounds so at least one background maintenance run
141
+ // executes after any earlier push-triggered debounce/in-flight window.
142
+ await triggerPull(app, clientId);
143
+ await new Promise((resolve) => setTimeout(resolve, 5));
144
+ await triggerPull(app, clientId);
145
+ await new Promise((resolve) => setTimeout(resolve, 5));
146
+ await triggerPull(app, clientId);
147
+ }
148
+
136
149
  async function countRows(tableName: 'sync_commits' | 'sync_changes') {
137
150
  if (tableName === 'sync_commits') {
138
151
  const row = await db
@@ -207,7 +220,7 @@ describe('createSyncRoutes maintenance automation', () => {
207
220
  updated_at = EXCLUDED.updated_at
208
221
  `.execute(db);
209
222
 
210
- await triggerPull(app, 'maintenance-client');
223
+ await triggerMaintenance(app, 'maintenance-client');
211
224
 
212
225
  await waitFor(
213
226
  async () => (await countRows('sync_commits')) <= 1,
@@ -244,7 +257,7 @@ describe('createSyncRoutes maintenance automation', () => {
244
257
  const oldIso = new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString();
245
258
  await db.updateTable('sync_commits').set({ created_at: oldIso }).execute();
246
259
 
247
- await triggerPull(app, 'compact-client');
260
+ await triggerMaintenance(app, 'compact-client');
248
261
 
249
262
  await waitFor(
250
263
  async () => (await countRows('sync_changes')) < before,