@prisma/client-engine-runtime 7.2.0-integration-fix-sqlite-deadlock-fix.1 → 7.2.0-integration-fix-enums-mapped-types-v7.2

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/dist/index.js CHANGED
@@ -2043,21 +2043,16 @@ var TransactionManager = class {
2043
2043
  const abortController = new AbortController();
2044
2044
  const startTimer = createTimeoutIfDefined(() => abortController.abort(), options.maxWait);
2045
2045
  startTimer?.unref?.();
2046
- transaction.transaction = await new Promise((resolve, reject) => {
2047
- void once(abortController.signal, "abort");
2048
- void this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing).then((tx) => {
2049
- if (abortController.signal.aborted) {
2050
- tx.rollback().catch((e) => debug("error in discarded transaction:", e));
2051
- resolve(void 0);
2052
- } else {
2053
- resolve(tx);
2054
- }
2055
- }, reject).finally(() => clearTimeout(startTimer));
2056
- });
2046
+ const startTransactionPromise = this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing);
2047
+ transaction.transaction = await Promise.race([
2048
+ startTransactionPromise.finally(() => clearTimeout(startTimer)),
2049
+ once(abortController.signal, "abort").then(() => void 0)
2050
+ ]);
2057
2051
  this.transactions.set(transaction.id, transaction);
2058
2052
  switch (transaction.status) {
2059
2053
  case "waiting":
2060
- if (transaction.transaction === void 0) {
2054
+ if (abortController.signal.aborted) {
2055
+ void startTransactionPromise.then((tx) => tx.rollback()).catch((e) => debug("error in discarded transaction:", e));
2061
2056
  await this.#closeTransaction(transaction, "timed_out");
2062
2057
  throw new TransactionStartTimeoutError();
2063
2058
  }
package/dist/index.mjs CHANGED
@@ -1992,21 +1992,16 @@ var TransactionManager = class {
1992
1992
  const abortController = new AbortController();
1993
1993
  const startTimer = createTimeoutIfDefined(() => abortController.abort(), options.maxWait);
1994
1994
  startTimer?.unref?.();
1995
- transaction.transaction = await new Promise((resolve, reject) => {
1996
- void once(abortController.signal, "abort");
1997
- void this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing).then((tx) => {
1998
- if (abortController.signal.aborted) {
1999
- tx.rollback().catch((e) => debug("error in discarded transaction:", e));
2000
- resolve(void 0);
2001
- } else {
2002
- resolve(tx);
2003
- }
2004
- }, reject).finally(() => clearTimeout(startTimer));
2005
- });
1995
+ const startTransactionPromise = this.driverAdapter.startTransaction(options.isolationLevel).catch(rethrowAsUserFacing);
1996
+ transaction.transaction = await Promise.race([
1997
+ startTransactionPromise.finally(() => clearTimeout(startTimer)),
1998
+ once(abortController.signal, "abort").then(() => void 0)
1999
+ ]);
2006
2000
  this.transactions.set(transaction.id, transaction);
2007
2001
  switch (transaction.status) {
2008
2002
  case "waiting":
2009
- if (transaction.transaction === void 0) {
2003
+ if (abortController.signal.aborted) {
2004
+ void startTransactionPromise.then((tx) => tx.rollback()).catch((e) => debug("error in discarded transaction:", e));
2010
2005
  await this.#closeTransaction(transaction, "timed_out");
2011
2006
  throw new TransactionStartTimeoutError();
2012
2007
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "7.2.0-integration-fix-sqlite-deadlock-fix.1",
3
+ "version": "7.2.0-integration-fix-enums-mapped-types-v7.2",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,10 +30,10 @@
30
30
  "nanoid": "5.1.5",
31
31
  "ulid": "3.0.0",
32
32
  "uuid": "11.1.0",
33
- "@prisma/debug": "7.2.0-integration-fix-sqlite-deadlock-fix.1",
34
- "@prisma/client-runtime-utils": "7.2.0-integration-fix-sqlite-deadlock-fix.1",
35
- "@prisma/sqlcommenter": "7.2.0-integration-fix-sqlite-deadlock-fix.1",
36
- "@prisma/driver-adapter-utils": "7.2.0-integration-fix-sqlite-deadlock-fix.1"
33
+ "@prisma/client-runtime-utils": "7.2.0-integration-fix-enums-mapped-types-v7.2",
34
+ "@prisma/driver-adapter-utils": "7.2.0-integration-fix-enums-mapped-types-v7.2",
35
+ "@prisma/debug": "7.2.0-integration-fix-enums-mapped-types-v7.2",
36
+ "@prisma/sqlcommenter": "7.2.0-integration-fix-enums-mapped-types-v7.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "29.5.14",