@classytic/mongokit 3.1.2 → 3.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1073,7 +1073,7 @@ var Repository = class {
1073
1073
  if (typeof options.onFallback === "function") {
1074
1074
  options.onFallback(err);
1075
1075
  }
1076
- if (started && session.inTransaction()) {
1076
+ if (started) {
1077
1077
  try {
1078
1078
  await session.abortTransaction();
1079
1079
  } catch {
@@ -1081,8 +1081,11 @@ var Repository = class {
1081
1081
  }
1082
1082
  return await callback(null);
1083
1083
  }
1084
- if (started && session.inTransaction()) {
1085
- await session.abortTransaction();
1084
+ if (started) {
1085
+ try {
1086
+ await session.abortTransaction();
1087
+ } catch {
1088
+ }
1086
1089
  }
1087
1090
  throw err;
1088
1091
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/mongokit",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "Production-grade MongoDB repositories with zero dependencies - smart pagination, events, and plugins",
5
5
  "type": "module",
6
6
  "sideEffects": false,