mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
f6076328fe
createJourney inserted the journey, then its owner row, then linked each trip with its skeleton entries and set the cover, every step committed on its own: a failure halfway left a journey nobody owned. It now runs as one transaction and broadcasts the linked trips after the commit. addTripToJourney links inside a transaction the same way. The photo paths wrapped only the gallery insert and left the entry link and the skeleton promotion outside; the photo row, the gallery row, the link and the promotion are one write now. removeTripFromJourney, updateEntry, updatePhoto, setPhotoProvider, the photo deletes and the place hooks write in one transaction each. createEntry and uploadGalleryPhotos read MAX(sort_order) inside the transaction that inserts, so two entries or uploads at once take one position each. reconcileTripSkeletons and the photo capture helpers are tagged as deliberately split for the transaction gate that follows.