Ghost/core/server/api/canary
Kevin Ansfield 8ad384d7f8 🐛 Fixed scheduled post emails pointing at /404/ for the "view online" link
no issue

When scheduling a post to publish+send the "view online" link was pointing at https://site.com/404/ rather than the published post's url.

The problem occurred because the `/schedules/` endpoint wraps it's post read+edit calls in a transaction. Context:
- when a post is published with with the "send email" option the email record is immediately generated and added to the API response, as part of the email record generation we render the email content including fetching the url for the "view online" link
- urls for all resources are handled by our `url` service, that service updates it's internal cache based upon model events such as the "edited" event triggered when a post is published
- if the posts API controller is given a transaction, the email record is also generated inside of that transaction however at this point the `url` service will not have been updated because the post record hasn't been committed meaning it has no available url for the post

Fix:
- removed the `models.Base.transaction()` wrapper around the post read+update in the `/schedules/` API controllers
- we don't need a transaction here. It was added as protection against another write request coming in between the `/schedules/` controller reading a post and publishing a post but we already have protection against that in the form of collision detection - if a write request comes in and commits between the schedules controller reading the post and updating it, the scheduler's update call will fail with a collision error at which point the scheduler itself should retry the request which could then publish the post successfully if everything else is in order
2020-10-08 10:26:49 +01:00
..
utils 🐛 Fixed meta attributes calculation on post preview 2020-10-05 17:52:40 +13:00
actions.js Updated canary actions endpoint 2019-08-14 17:40:36 +08:00
authentication.js Moved config from server to shared (#11850) 2020-05-27 18:47:53 +01:00
authors-public.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
config.js Added new portal config flag 2020-09-17 19:40:34 +05:30
db.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
email-preview.js Refactor mega service to use stored email content and batch/recipient records 2020-09-29 17:17:54 +01:00
email.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
identities.js Moved core/server/lib/url-utils to core/shared/url-utils (#11856) 2020-05-28 11:57:02 +01:00
images.js 💡 Added canary api endpoint 2019-08-09 20:46:49 +05:30
index.js Added membersStripeConnect controller auth method 2020-06-02 15:28:42 +02:00
integrations.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
invites.js Extracted core/server/lib/security to @tryghost/security package 2020-08-11 14:06:50 +01:00
labels.js Added more specific error handling when adding duplicate labels 2020-06-05 00:23:10 +12:00
mail.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
members.js Ensured Admin API members resource only returns known fields (#12240) 2020-09-30 10:22:22 +01:00
memberSigninUrls.js Updated getMagicLink call to handle Promise return 2020-09-18 10:49:18 +01:00
membersStripeConnect.js Supported test mode in members_stripe_connect API 2020-06-10 14:06:57 +02:00
notifications.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
oembed.js 🐛 Fixed broken embeds cards when pasting links to Wordpress sites (#12262) 2020-10-06 08:44:03 +01:00
pages-public.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
pages.js Allowed ?formats param in Admin API post+page create/edit requests 2020-06-18 13:59:01 +01:00
posts-public.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
posts.js Changed member limit to be DRY & use raw query 2020-07-26 20:49:30 +01:00
preview.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
redirects.js 💡 Added canary api endpoint 2019-08-09 20:46:49 +05:30
roles.js 💡 Added canary api endpoint 2019-08-09 20:46:49 +05:30
schedules.js 🐛 Fixed scheduled post emails pointing at /404/ for the "view online" link 2020-10-08 10:26:49 +01:00
session.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
settings-public.js Moved core/server/lib/url-utils to core/shared/url-utils (#11856) 2020-05-28 11:57:02 +01:00
settings.js 🐛 Fixed email verification mails not sent 2020-09-24 23:39:25 +05:30
site.js Allowed accent color setting for site with portal flag 2020-10-02 15:30:54 +05:30
slack.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
slugs.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
tags-public.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
tags.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
themes.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
users.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
webhooks.js Added check for parent integration_id when creating a webhook 2020-09-24 15:09:51 +12:00