@webqit/webflo 1.0.30 → 1.0.32

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
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "1.0.30",
15
+ "version": "1.0.32",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -134,6 +134,8 @@ export class Capabilities {
134
134
  if (this.#exposed.custom_install === 'granted') return;
135
135
  if (this.#exposed.custom_install) {
136
136
  returnValue = await this.#exposed.custom_install.prompt?.();
137
+ const { outcome } = await this.#exposed.custom_install.userChoice;
138
+ if (outcome === 'dismissed') return;
137
139
  }
138
140
  Observer.set(this.#exposed, 'custom_install', 'granted');
139
141
  return returnValue;
@@ -6,13 +6,17 @@ export class SessionStorage extends WebfloStorage {
6
6
 
7
7
  static create(request, params = {}) {
8
8
  let sessionID = request.headers.get('Cookie', true).find((c) => c.name === '__sessid')?.value;
9
- if (sessionID?.includes('.') && params.secret) {
10
- const [rand, signature] = sessionID.split('.');
11
- const expectedSignature = crypto.createHmac('sha256', params.secret)
12
- .update(rand)
13
- .digest('hex');
14
- if (signature !== expectedSignature) {
15
- sessionID = undefined;
9
+ if (sessionID?.includes('.')) {
10
+ if (params.secret) {
11
+ const [rand, signature] = sessionID.split('.');
12
+ const expectedSignature = crypto.createHmac('sha256', params.secret)
13
+ .update(rand)
14
+ .digest('hex');
15
+ if (signature !== expectedSignature) {
16
+ sessionID = undefined;
17
+ }
18
+ } else {
19
+ sessionID = null;
16
20
  }
17
21
  }
18
22
  if (!sessionID) {
@@ -121,6 +121,12 @@ export class WebfloServer extends WebfloRuntime {
121
121
  }
122
122
  this.#cx.logger.info(``);
123
123
  }
124
+ process.on('uncaughtException', (err) => {
125
+ console.error('Uncaught Exception:', err);
126
+ });
127
+ process.on('unhandledRejection', (reason, promise) => {
128
+ console.log('Unhandled Rejection', reason, promise);
129
+ });
124
130
  }
125
131
 
126
132
  control() {
@@ -191,11 +197,23 @@ export class WebfloServer extends WebfloRuntime {
191
197
  const pgClient = new pg.Pool({
192
198
  connectionString: process.env[this.#cx.server.capabilities.database_url_variable],
193
199
  database: 'postgres',
194
- idleTimeoutMillis: 30000, // 30 seconds,
195
- keepAlive: true
200
+ idle_in_transaction_session_timeout: 0
196
201
  });
197
202
  // Connect
198
- await pgClient.connect();
203
+ await (async function connect() {
204
+ /*
205
+ pgClient.on('error', (e) => {
206
+ console.log('____________error_', e);
207
+ });
208
+ pgClient.on('end', (e) => {
209
+ console.log('____________end_', e);
210
+ });
211
+ pgClient.on('notice', (e) => {
212
+ console.log('____________notice_', e);
213
+ });
214
+ */
215
+ await pgClient.connect();
216
+ })();
199
217
  this.#sdk.db = new SQLClient(pgClient, { dialect: 'postgres' });
200
218
  } else {
201
219
  console.log('No database capabilities');