Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Ensured that we do not insert orphaned rows #190

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

allouis
Copy link
Collaborator

@allouis allouis commented Jul 24, 2020

no-issue

Previously we would blindly put subscriptions into the database when we
received a webhook, which could result in orphaned rows that were not
linked to a customer (and by extension a member)

This updates the logic so that we will only add subscriptions if we have
a record of their customer.

Customers are only added during a checkout.session.completed webhook, at
which point a member is guarunteed, but for formailty and safety against
changes in the flow, the logic has been applied to inserting customers
too.

no-issue

Previously we would blindly put subscriptions into the database when we
received a webhook, which could result in orphaned rows that were not
linked to a customer (and by extension a member)

This updates the logic so that we will only add subscriptions if we have
a record of their customer.

Customers are only added during a checkout.session.completed webhook, at
which point a member is guarunteed, but for formailty and safety against
changes in the flow, the logic has been applied to inserting customers
too.
@allouis allouis merged commit 2676ebc into TryGhost:master Jul 24, 2020
@allouis allouis deleted the ensure-no-orphaned-rows branch July 24, 2020 13:39
allouis added a commit to allouis/Ghost that referenced this pull request Jul 24, 2020
no-issue

This contains an update which ensures that we do not insert orphaned
rows into the database

Includes code from: TryGhost/Members#190
allouis added a commit to TryGhost/Ghost that referenced this pull request Jul 24, 2020
no-issue

This contains an update which ensures that we do not insert orphaned
rows into the database

Includes code from: TryGhost/Members#190
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant