1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Only run Plaid syncs via webhook after initial sync
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

This commit is contained in:
Zach Gollwitzer 2025-05-12 18:55:19 -04:00
parent 908b3e2489
commit 9e6e4b1ce6
5 changed files with 14 additions and 33 deletions

View file

@ -74,11 +74,6 @@ class Family < ApplicationRecord
account.sync_later(start_date: start_date, parent_sync: sync) account.sync_later(start_date: start_date, parent_sync: sync)
end end
Rails.logger.info("Syncing plaid items for family #{id}")
plaid_items.each do |plaid_item|
plaid_item.sync_later(start_date: start_date, parent_sync: sync)
end
Rails.logger.info("Applying rules for family #{id}") Rails.logger.info("Applying rules for family #{id}")
rules.each do |rule| rules.each do |rule|
rule.apply_later rule.apply_later

View file

@ -2,6 +2,7 @@
<h1 class="text-xl"><%= t(".accounts") %></h1> <h1 class="text-xl"><%= t(".accounts") %></h1>
<div class="flex items-center gap-5"> <div class="flex items-center gap-5">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<% if Rails.env.development? %>
<%= render ButtonComponent.new( <%= render ButtonComponent.new(
text: "Sync all", text: "Sync all",
href: sync_all_accounts_path, href: sync_all_accounts_path,
@ -9,8 +10,8 @@
variant: "outline", variant: "outline",
disabled: Current.family.syncing?, disabled: Current.family.syncing?,
icon: "refresh-cw", icon: "refresh-cw",
class: ""
) %> ) %>
<% end %>
<%= render LinkComponent.new( <%= render LinkComponent.new(
text: "New account", text: "New account",

View file

@ -20,23 +20,12 @@
<% end %> <% end %>
<div class="flex items-center gap-1 ml-auto"> <div class="flex items-center gap-1 ml-auto">
<% if account.plaid_account_id.present? %>
<% if Rails.env.development? %> <% if Rails.env.development? %>
<%= icon( <%= icon(
"refresh-cw", "refresh-cw",
as_button: true, as_button: true,
size: "sm", size: "sm",
href: sync_plaid_item_path(account.plaid_account.plaid_item), href: account.linked? ? sync_plaid_item_path(account.plaid_account.plaid_item) : sync_account_path(account),
disabled: account.syncing?,
frame: :_top
) %>
<% end %>
<% else %>
<%= icon(
"refresh-cw",
as_button: true,
size: "sm",
href: sync_account_path(account),
disabled: account.syncing?, disabled: account.syncing?,
frame: :_top frame: :_top
) %> ) %>

View file

@ -92,7 +92,7 @@
</div> </div>
</div> </div>
<% end %> <% end %>
<% else %> <% elsif Rails.env.development? %>
<%= icon( <%= icon(
"refresh-cw", "refresh-cw",
as_button: true, as_button: true,

View file

@ -20,10 +20,6 @@ class FamilyTest < ActiveSupport::TestCase
.with(start_date: nil, parent_sync: family_sync) .with(start_date: nil, parent_sync: family_sync)
.times(manual_accounts_count) .times(manual_accounts_count)
PlaidItem.any_instance.expects(:sync_later)
.with(start_date: nil, parent_sync: family_sync)
.times(items_count)
@syncable.sync_data(family_sync, start_date: family_sync.start_date) @syncable.sync_data(family_sync, start_date: family_sync.start_date)
end end
end end