Updated subscription handling to lock db rows

refs https://github.com/TryGhost/Team/issues/1248
refs https://github.com/TryGhost/Team/issues/1302
refs https://github.com/TryGhost/Ghost/pull/14433

This fixes multiple problems we've had with handling stripe webhooks where
linking the same subscription concurrently was not locking the database row, we
would have the same operation attempted multiple times, in the case of creating
subscriptions this causes unique constraint errors, and in the case of creating
cancellation events, it was causing multiple cancellation events to be created.
This commit is contained in:
Fabien "egg" O'Carroll 2022-04-07 15:20:08 +01:00
parent 6507a0b88e
commit 7b0fbe955c
2 changed files with 5 additions and 5 deletions

View File

@ -83,7 +83,7 @@
"@tryghost/logging": "2.1.2",
"@tryghost/magic-link": "1.0.21",
"@tryghost/member-events": "0.4.1",
"@tryghost/members-api": "5.6.0",
"@tryghost/members-api": "5.6.1",
"@tryghost/members-events-service": "0.3.2",
"@tryghost/members-importer": "0.5.6",
"@tryghost/members-offers": "0.10.9",

View File

@ -2069,10 +2069,10 @@
"@tryghost/domain-events" "^0.1.9"
"@tryghost/member-events" "^0.4.1"
"@tryghost/members-api@5.6.0":
version "5.6.0"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-5.6.0.tgz#af84c73d273eb8321909ff23d457d1144916d838"
integrity sha512-XOn0eZVNy9IK7F9SkTTMyw59/iqYEsmRiAvZ6DPQbGL2O+FXIUdGnuGw1lJ2q33QWxBDpZ63oyj6rByVZiHu5A==
"@tryghost/members-api@5.6.1":
version "5.6.1"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-5.6.1.tgz#5d04716701e813c3bfbc1be8f016a412859e1313"
integrity sha512-Wamvr4rwl9ENt+Ue7o5nnBWuRlhXPYc5yoXn/2D87B2S1hMKhk+tu7zQ/0Hjb4ounZ9ypKR4Lp/KdC4RO5lPsQ==
dependencies:
"@nexes/nql" "^0.6.0"
"@tryghost/debug" "^0.1.2"