When Rules Are Triggered
Rules run automatically during family syncs or can be triggered manually. Understanding when rules execute helps troubleshoot categorization issues.Manual trigger (user-initiated)
Manual trigger (user-initiated)
Rules can be manually triggered in the following ways:
- Clicking “Re-apply” on an individual rule in
/settings/rules - Clicking “Apply All” in
/settings/rules - Running the rake task:
bin/rails rules:apply_all[family_id]
During family sync (only active rules)
During family sync (only active rules)
Rules with
active: true run automatically when a family sync occurs (Family::Syncer.perform_sync):Scheduled syncs:SyncAllJob- runs daily at 2:22 AM for all familiesSyncHourlyJob- runs every hour (for items that opt-in to hourly syncing)
- Provider webhooks (Plaid, etc.) - triggers sync which eventually propagates to family
- Manual sync button on accounts page
- After CSV imports complete (
Importmodel callsfamily.sync_later)
When rules do NOT run
When rules do NOT run
Rules are not triggered in these scenarios:
- Manual transaction creation - Only triggers an Account sync (not Family sync)
- Manual transaction editing - Same as above, only Account sync runs
- Inactive rules - Rules with
active: falsenever run automatically, only via manual “Re-apply”
Category Rule Popup Behavior
When a user selects a category for a transaction, a popup may appear to create an automatic categorization rule. This popup is intentionally gated by several conditions:When does the popup appear?
When does the popup appear?
The popup only shows when all of these conditions are met:
- User has not disabled rule prompts (
rule_prompts_disabledis false) - User hasn’t dismissed the popup in the last 24 hours
- The transaction category actually changed
- No existing rule already sets this category for similar transactions
- The transaction has a category assigned
Why isn't the popup showing?
Why isn't the popup showing?
Check these common reasons:
- Recently dismissed: Wait 24 hours after dismissing the popup
- Rule already exists: A matching rule may already be in place
- Prompts disabled: Check if
rule_prompts_disabledis enabled for the user
Sure Doesn’t Work Over HTTPS
If Sure behaves incorrectly or fails when accessed over HTTPS, it’s usually due to missing SSL-related configuration between Nginx and Rails.What causes this issue?
What causes this issue?
Sure relies on correct protocol headers to determine whether a request is secure.
When HTTPS is terminated at Nginx but not properly forwarded to the app, Rails may treat requests as HTTP.
When HTTPS is terminated at Nginx but not properly forwarded to the app, Rails may treat requests as HTTP.
How do I fix it?
How do I fix it?
Apply the following configuration changes:
-
Nginx
Ensure HTTPS is forwarded to the upstream app:
-
docker-compose.yml
In the
x-rails-env: &rails_envsection, set:This tells Rails to treat all requests as HTTPS.
Some pages break over HTTPS
Sure uses WebSockets for certain pages. If some pages fail to render correctly or break entirely, this is often caused by missing SSL or upgrade headers in your reverse proxy configuration.What are the symptoms?
What are the symptoms?
You may see pages partially load, fail completely, or errors similar to:This indicates that the WebSocket upgrade request is not being forwarded correctly.
How do I fix it?
How do I fix it?
Ensure your Nginx configuration includes the required WebSocket headers:These headers allow Nginx to properly handle WebSocket upgrade requests over HTTPS.