Ghost/ghost/members-api/lib
Rishabh Garg 8a598fe721
🐛 Fixed member importer crash for failed imports (#15560)
refs/closes https://github.com/TryGhost/Team/issues/2004

- for imports, members are created inside a transaction, which causes the member created events to be dispatched.
- its possible that transactions for import can be rolled back if for some reason there is an error down the line while inserting other member properties. The rollback doesn't commit the member to DB, but the event dispatched earlier will still try to create the member created event which fails due to missing member id.
- knex transactions resolve the `executionPromise` both in case of explicit commit or rollback from the user, so just the transaction end check will not be good enough to make sure the member exists in DB
- adds explicit config to knex to reject transaction in case of rollback, which is then caught and event is not dispatched
2022-10-07 19:15:18 +05:30
..
controllers 🔒 Prevented member creation when logging in (#15526) 2022-10-05 12:42:42 +02:00
repositories 🐛 Fixed member importer crash for failed imports (#15560) 2022-10-07 19:15:18 +05:30
services Added referrer attribution from request context (#15499) 2022-09-29 22:31:48 +05:30
MembersAPI.js 🔒 Prevented member creation when logging in (#15526) 2022-10-05 12:42:42 +02:00