Skip to content

#1480 as-an-operator-the-backfilltransactions-operation-will-upser#1481

Merged
chrisjsimpson merged 4 commits intomasterfrom
1480-as-an-operator-the-backfilltransactions-operation-will-upser
Nov 9, 2025
Merged

#1480 as-an-operator-the-backfilltransactions-operation-will-upser#1481
chrisjsimpson merged 4 commits intomasterfrom
1480-as-an-operator-the-backfilltransactions-operation-will-upser

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Nov 8, 2025

Pull request related issue: #1480. Please pull these awesome changes in!

Updated `backfill_transactions()` in `subscribie/utils.py` to create missing
Transaction records from Stripe PaymentIntents, not just update existing ones.

Changes to `subscribie/utils.py`:
- Create new Transaction records when PaymentIntent exists in Stripe but not locally
- Link transactions to subscriptions via invoice lookup
- Link transactions to persons via subscription or metadata (person_uuid)
- Handle donation transactions from metadata (is_donation, donation_comment)
- Process transactions in all payment statuses (not just succeeded)
- Update all relevant fields (amount, currency, payment_status, created_at)
- Log summary of created vs updated transaction counts

Changes to `subscribie/blueprints/admin/__init__.py`:
- Enhanced logging in `do_backfill_data()` background task
- Add visible separator lines (===) for easy log identification
- Add `sys.stdout.flush()` after each log to ensure immediate console output
- Add full traceback logging on all errors
- Add outer try-catch to capture fatal thread errors

The upsert logic now matches `stripe_process_event_payment_intent_succeeded()`
in `subscribie/blueprints/checkout/__init__.py` for consistency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@chrisjsimpson chrisjsimpson force-pushed the 1480-as-an-operator-the-backfilltransactions-operation-will-upser branch from e6918a1 to eaa4392 Compare November 8, 2025 22:35
@chrisjsimpson chrisjsimpson force-pushed the 1480-as-an-operator-the-backfilltransactions-operation-will-upser branch from 0536784 to be7ea83 Compare November 9, 2025 18:20
@chrisjsimpson chrisjsimpson force-pushed the 1480-as-an-operator-the-backfilltransactions-operation-will-upser branch from be7ea83 to 1c28323 Compare November 9, 2025 18:21
@chrisjsimpson chrisjsimpson merged commit 8a8b17d into master Nov 9, 2025
3 checks passed
@github-actions
Copy link
Author

github-actions bot commented Nov 9, 2025

🚀 PR was released in v0.1.250 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Nov 9, 2025
@github-actions
Copy link
Author

github-actions bot commented Nov 9, 2025

🚀 PR was released in v0.1.250 🚀

1 similar comment
@github-actions
Copy link
Author

github-actions bot commented Nov 9, 2025

🚀 PR was released in v0.1.250 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant