mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
fix(server): run the remaining multi-statement service writes in one transaction
A sweep of the services for write sequences that committed step by step, each one leaving half a change behind when the next statement failed: - accommodations: the linked bookings' times moved after the stay's own transaction had committed - airports: the boot backfill wrote a flight's two endpoints one at a time, and a flight left with only the first was never picked up again; each flight is its own transaction now - auth: the admin settings form and a password reset (retire the old link, issue the new one) each land whole - oauth: a refresh revoked the old pair before issuing the new one, so a failure in between logged the client out; rotating a client secret and revoking its tokens go together too - oidc: the identity link, the role from the claims and the avatar of a returning user are one write - addons, notification preferences: a settings save lands whole - places: create with its tags, update, and the GPX/KML imports with their track colours - trips: the trip row, the shifted leave entries and the rebuilt day grid - vacay: a first visit provisions the plan in one transaction with a second look against a concurrent first visit; updatePlan fetches the public holidays between two transactions instead of inside its writes - memories: a photo and its trip link, and the deletes with the orphan sweep behind them AddonsService, AirportsService and OauthService take the UnitOfWork for this. Network I/O stays outside every transaction. Comments that only narrated the migration plan make room under the lint:size entries, which drop with them.
This commit is contained in:
@@ -232,6 +232,7 @@ describe('plugin boot vs registry scan ordering', () => {
|
||||
t2.repo(PhotoProviderFields),
|
||||
t2.repo(AppSettings),
|
||||
t2.repo(Users),
|
||||
new UnitOfWork(t2.em),
|
||||
);
|
||||
const auditLogRepo2 = t2.repo(AuditLog);
|
||||
const usersRepo2 = t2.repo(Users);
|
||||
|
||||
Reference in New Issue
Block a user