@pinelab/vendure-plugin-qls-fulfillment 1.1.0 → 1.1.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.1.1 (2026-01-07)
2
+
3
+ - Ignoring non-existing order codes in order status updates, instead of throwing an error.
4
+ - Update `syncedToQls` custom field inside same transaction, to prevent `Query runner already released. Cannot run queries anymore` errors.
5
+
1
6
  # 1.1.0 (2026-01-07)
2
7
 
3
8
  - Fix delivery options to be an array of objects with a tag property
@@ -164,17 +164,17 @@ let QlsOrderService = class QlsOrderService {
164
164
  isPublic: false,
165
165
  note: `Created order '${result.id}' in QLS`,
166
166
  });
167
- // Delay 10s to prevent race conditions: OrderPlacedEvent is emitted before transition to PaymentSettled is complete
168
- setTimeout(() => {
169
- this.orderService
170
- .updateCustomFields(ctx, orderId, {
171
- syncedToQls: true,
172
- })
173
- .catch((e) => {
174
- const error = (0, catch_unknown_1.asError)(e);
175
- core_2.Logger.error(`Error updating custom field 'syncedToQls: true' for order '${order.code}': ${error.message}`, constants_1.loggerCtx, error.stack);
176
- });
177
- }, 10000);
167
+ // Delayed custom field update to prevent race conditions: OrderPlacedEvent is emitted before transition to PaymentSettled is complete
168
+ await new Promise((resolve) => setTimeout(resolve, 5000));
169
+ await this.orderService
170
+ .updateCustomFields(ctx, orderId, {
171
+ syncedToQls: true,
172
+ })
173
+ .catch((e) => {
174
+ // catch any errors, because we don't want the job to fail and retry when custom field update fails
175
+ const error = (0, catch_unknown_1.asError)(e);
176
+ core_2.Logger.error(`Error updating custom field 'syncedToQls: true' for order '${order.code}': ${error.message}`, constants_1.loggerCtx, error.stack);
177
+ });
178
178
  return `Order '${order.code}' created in QLS with id '${result.id}'`;
179
179
  }
180
180
  catch (e) {
@@ -196,7 +196,7 @@ let QlsOrderService = class QlsOrderService {
196
196
  const orderCode = body.customer_reference;
197
197
  const order = await this.orderService.findOneByCode(ctx, orderCode, []);
198
198
  if (!order) {
199
- throw new Error(`Order with code '${orderCode}' not found`);
199
+ return core_2.Logger.warn(`Order with code '${orderCode}' not found, ignoring order status update`, constants_1.loggerCtx);
200
200
  }
201
201
  const client = await (0, qls_client_1.getQlsClient)(ctx, this.options);
202
202
  if (!client) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinelab/vendure-plugin-qls-fulfillment",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Vendure plugin to fulfill orders via QLS.",
5
5
  "keywords": [
6
6
  "fulfillment",
@@ -32,5 +32,5 @@
32
32
  "dependencies": {
33
33
  "catch-unknown": "^2.0.0"
34
34
  },
35
- "gitHead": "8f5d76680b66b12b9fb3732a4205b4ce20686076"
35
+ "gitHead": "3196fb0d33aa3dd6f31734bdbce94be827b852dd"
36
36
  }