Skip to content

Analytics charges; staging restore script; signup agreement checkbox fix; marketing dispatch error save - #936

Merged
rgalanakis merged 7 commits into
mainfrom
analytics-charge-obj-created
Jun 26, 2026
Merged

Analytics charges; staging restore script; signup agreement checkbox fix; marketing dispatch error save#936
rgalanakis merged 7 commits into
mainfrom
analytics-charge-obj-created

Conversation

@rgalanakis

Copy link
Copy Markdown
Member

Marketing SMS dispatch: Save to DB on error

We were losing error information.


Fix signup agreement div click issue

Clicking the div would update the React state,
but not the React Hook Form state, which works based on the native
input state, which isn't changing with React's rendering.

This uses refs to keep things in sync, and drives the state
from the checkbox rather than higher up state
created through React.useState.


Convert some FKs to ON DELETE CASCADE

Found while working on the release fixup,
these should logically already be CASCADE.


Support secure restores to staging

This adds a new rake task that can be used to restore a production dump
to a staging database, removing all non-admin member data.

This ensures that even if someone makes it to staging or
somehow grabs a copy of the DB, no member data is included.


Rename prepare_prod_db_for_testing

It's only valid for local dev, since it contains potentially
sensitive data; it should not be used in places like staging.


Analytics: Add charge.incurred_at

We need to know when the charge was incurred by the user,
not when Suma processed it, for example if we have to do
a historical import.

We need to know when the charge was incurred by the user,
not when Suma processed it, for example if we have to do
a historical import.
It's only valid for local dev, since it contains potentially
sensitive data; it should not be used in places like staging.
This adds a new rake task that can be used to restore a production dump
to a staging database, removing all non-admin member data.

This ensures that even if someone makes it to staging or
somehow grabs a copy of the DB, no member data is included.
Found while working on the release fixup,
these should logically already be CASCADE.
Clicking the div would update the React state,
but not the React Hook Form state, which works based on the native
input state, which isn't changing with React's rendering.

This uses refs to keep things in sync, and drives the state
from the checkbox rather than higher up state
created through React.useState.
We were losing error information.
@rgalanakis
rgalanakis force-pushed the analytics-charge-obj-created branch from 1a5b09c to 104e88a Compare June 26, 2026 04:07
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.49624% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.78%. Comparing base (1e8ffc1) to head (033ccc9).

Files with missing lines Patch % Lines
lib/suma/tasks/release.rb 97.72% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #936      +/-   ##
==========================================
- Coverage   99.79%   99.78%   -0.01%     
==========================================
  Files         755      755              
  Lines       37871    37983     +112     
==========================================
+ Hits        37793    37901     +108     
- Misses         78       82       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rgalanakis
rgalanakis merged commit a08e967 into main Jun 26, 2026
3 of 5 checks passed
@rgalanakis
rgalanakis deleted the analytics-charge-obj-created branch June 26, 2026 15:58
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.

1 participant