Skip to content

Conversation

@jurgenwerk
Copy link
Contributor

@jurgenwerk jurgenwerk commented Jan 26, 2026

This PR fixes a bug where we process a webhook coming from Stripe when a new subscription is made, or when it renews.

At that time we create a new subscription_cycles record, which has fields period_start, period_end, which we read from the event's payload. The issue is that the source of where we are reading these values is wrong - we are reading the invoice period while we should be reading the subscription period which is included in the invoice's line item.

So the result of this error is that the subscription cycle periods are lagging 1 month behind. This PR fixes this with a data fix migration and adjusted logic to read the periods from the correct attributes in stripe event's payload.

@github-actions
Copy link

github-actions bot commented Jan 26, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   1h 42m 56s ⏱️ +40s
1 925 tests ±0  1 908 ✅ ±0  17 💤 ±0  0 ❌ ±0 
1 940 runs  ±0  1 923 ✅ ±0  17 💤 ±0  0 ❌ ±0 

Results for commit 52171b3. ± Comparison against base commit 789381a.

♻️ This comment has been updated with latest results.

@jurgenwerk jurgenwerk force-pushed the fix-subscription-cycle-dates branch from 514c7db to c1dff08 Compare January 27, 2026 12:48
@github-actions
Copy link

Preview deployments

@jurgenwerk jurgenwerk marked this pull request as ready for review January 28, 2026 12:51
@jurgenwerk jurgenwerk requested a review from a team January 28, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants