@powersync/service-module-postgres-storage 0.0.0-dev-20250825132649 → 0.0.0-dev-20250827072023

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.
@@ -33,13 +33,13 @@ export declare const SyncRules: t.ObjectCodec<{
33
33
  *
34
34
  * This may be old if no data is incoming.
35
35
  */
36
- last_checkpoint_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string, string, t.CodecProps>>;
36
+ last_checkpoint_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string | import("@powersync/service-sync-rules").DateTimeValue, string, t.CodecProps>>;
37
37
  /**
38
38
  * Last time we persisted a checkpoint or keepalive.
39
39
  *
40
40
  * This should stay fairly current while replicating.
41
41
  */
42
- last_keepalive_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string, string, t.CodecProps>>;
42
+ last_keepalive_ts: t.Union<t.Codec<null, null, string, t.CodecProps>, t.Codec<Date, string | import("@powersync/service-sync-rules").DateTimeValue, string, t.CodecProps>>;
43
43
  /**
44
44
  * If an error is stopping replication, it will be stored here.
45
45
  */
@@ -217,7 +217,7 @@ export class PostgresReportStorageFactory {
217
217
  AND (
218
218
  disconnected_at IS NOT NULL
219
219
  OR (
220
- jwt_exp < NOW()
220
+ jwt_exp < NOW() AT TIME ZONE 'UTC'
221
221
  AND disconnected_at IS NULL
222
222
  )
223
223
  );
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@powersync/service-module-postgres-storage",
3
3
  "repository": "https://github.com/powersync-ja/powersync-service",
4
4
  "types": "dist/@types/index.d.ts",
5
- "version": "0.0.0-dev-20250825132649",
5
+ "version": "0.0.0-dev-20250827072023",
6
6
  "main": "dist/index.js",
7
7
  "type": "module",
8
8
  "publishConfig": {
@@ -28,14 +28,14 @@
28
28
  "p-defer": "^4.0.1",
29
29
  "ts-codec": "^1.3.0",
30
30
  "uuid": "^11.1.0",
31
- "@powersync/lib-service-postgres": "0.0.0-dev-20250825132649",
32
- "@powersync/lib-services-framework": "0.0.0-dev-20250825132649",
33
- "@powersync/service-core": "0.0.0-dev-20250825132649",
34
- "@powersync/service-types": "0.0.0-dev-20250825132649",
35
- "@powersync/service-core-tests": "0.0.0-dev-20250825132649",
36
- "@powersync/service-jpgwire": "0.0.0-dev-20250825132649",
37
- "@powersync/service-jsonbig": "0.0.0-dev-20250825132649",
38
- "@powersync/service-sync-rules": "0.0.0-dev-20250825132649"
31
+ "@powersync/lib-service-postgres": "0.0.0-dev-20250827072023",
32
+ "@powersync/lib-services-framework": "0.0.0-dev-20250827072023",
33
+ "@powersync/service-core": "0.0.0-dev-20250827072023",
34
+ "@powersync/service-types": "0.0.0-dev-20250827072023",
35
+ "@powersync/service-core-tests": "0.0.0-dev-20250827072023",
36
+ "@powersync/service-jpgwire": "0.0.0-dev-20250827072023",
37
+ "@powersync/service-jsonbig": "0.0.0-dev-20250827072023",
38
+ "@powersync/service-sync-rules": "0.0.0-dev-20250827072023"
39
39
  },
40
40
  "devDependencies": {
41
41
  "typescript": "^5.7.3"
@@ -234,7 +234,7 @@ export class PostgresReportStorageFactory implements storage.ReportStorage {
234
234
  AND (
235
235
  disconnected_at IS NOT NULL
236
236
  OR (
237
- jwt_exp < NOW()
237
+ jwt_exp < NOW() AT TIME ZONE 'UTC'
238
238
  AND disconnected_at IS NULL
239
239
  )
240
240
  );
@@ -55,43 +55,29 @@ exports[`Connection report storage > Should delete rows older than specified ran
55
55
  }
56
56
  `;
57
57
 
58
- exports[`Connection report storage > Should show connected users with start range 1`] = `
59
- {
60
- "sdks": [
61
- {
62
- "clients": 1,
63
- "sdk": "powersync-dart/1.6.4",
64
- "users": 1,
65
- },
66
- {
67
- "clients": 1,
68
- "sdk": "powersync-js/1.21.1",
69
- "users": 1,
70
- },
71
- {
72
- "clients": 1,
73
- "sdk": "unknown",
74
- "users": 1,
75
- },
76
- ],
77
- "users": 2,
78
- }
58
+ exports[`Connection report storage > Should update a connection event and make it disconnected 1`] = `
59
+ [
60
+ {
61
+ "client_id": "client_three",
62
+ "sdk": "powersync-js/1.21.2",
63
+ "user_agent": "powersync-js/1.21.0 powersync-web Firefox/141 linux",
64
+ "user_id": "user_three",
65
+ },
66
+ ]
79
67
  `;
80
68
 
81
- exports[`Connection report storage > Should show connected users with start range and end range 1`] = `
82
- {
83
- "sdks": [
84
- {
85
- "clients": 1,
86
- "sdk": "powersync-js/1.21.1",
87
- "users": 1,
88
- },
89
- ],
90
- "users": 1,
91
- }
69
+ exports[`Connection report storage > Should update a connection event if its within a day 1`] = `
70
+ [
71
+ {
72
+ "client_id": "client_one",
73
+ "sdk": "powersync-dart/1.6.4",
74
+ "user_agent": "powersync-dart/1.6.4 Dart (flutter-web) Chrome/128 android",
75
+ "user_id": "user_one",
76
+ },
77
+ ]
92
78
  `;
93
79
 
94
- exports[`Connection report storage > Should show connection report data for user over the past day 1`] = `
80
+ exports[`Report storage tests > Should show connection report data for user over the past day 1`] = `
95
81
  {
96
82
  "sdks": [
97
83
  {
@@ -119,7 +105,7 @@ exports[`Connection report storage > Should show connection report data for user
119
105
  }
120
106
  `;
121
107
 
122
- exports[`Connection report storage > Should show connection report data for user over the past month 1`] = `
108
+ exports[`Report storage tests > Should show connection report data for user over the past month 1`] = `
123
109
  {
124
110
  "sdks": [
125
111
  {
@@ -167,7 +153,7 @@ exports[`Connection report storage > Should show connection report data for user
167
153
  }
168
154
  `;
169
155
 
170
- exports[`Connection report storage > Should show connection report data for user over the past week 1`] = `
156
+ exports[`Report storage tests > Should show connection report data for user over the past week 1`] = `
171
157
  {
172
158
  "sdks": [
173
159
  {
@@ -205,46 +191,25 @@ exports[`Connection report storage > Should show connection report data for user
205
191
  }
206
192
  `;
207
193
 
208
- exports[`Connection report storage > Should update a connected sdk event and make it disconnected 1`] = `
209
- [
210
- {
211
- "client_id": "client_three",
212
- "sdk": "powersync-js/1.21.2",
213
- "user_agent": "powersync-js/1.21.0 powersync-web Firefox/141 linux",
214
- "user_id": "user_three",
215
- },
216
- ]
217
- `;
218
-
219
- exports[`Connection report storage > Should update a connection event and make it disconnected 1`] = `
220
- [
221
- {
222
- "client_id": "client_three",
223
- "sdk": "powersync-js/1.21.2",
224
- "user_agent": "powersync-js/1.21.0 powersync-web Firefox/141 linux",
225
- "user_id": "user_three",
226
- },
227
- ]
228
- `;
229
-
230
- exports[`Connection report storage > Should update a connection event if its within a day 1`] = `
231
- [
232
- {
233
- "client_id": "client_one",
234
- "sdk": "powersync-dart/1.6.4",
235
- "user_agent": "powersync-dart/1.6.4 Dart (flutter-web) Chrome/128 android",
236
- "user_id": "user_one",
237
- },
238
- ]
239
- `;
240
-
241
- exports[`Connection report storage > Should update a sdk event if its within a day 1`] = `
242
- [
243
- {
244
- "client_id": "client_one",
245
- "sdk": "powersync-dart/1.6.4",
246
- "user_agent": "powersync-dart/1.6.4 Dart (flutter-web) Chrome/128 android",
247
- "user_id": "user_one",
248
- },
249
- ]
194
+ exports[`Report storage tests > Should show currently connected users 1`] = `
195
+ {
196
+ "sdks": [
197
+ {
198
+ "clients": 1,
199
+ "sdk": "powersync-dart/1.6.4",
200
+ "users": 1,
201
+ },
202
+ {
203
+ "clients": 1,
204
+ "sdk": "powersync-js/1.21.1",
205
+ "users": 1,
206
+ },
207
+ {
208
+ "clients": 1,
209
+ "sdk": "unknown",
210
+ "users": 1,
211
+ },
212
+ ],
213
+ "users": 2,
214
+ }
250
215
  `;