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

Lazy load Plaid link tokens, fix link issues on broadcast (#2302)

* Lazy load Plaid link tokens, fix link issues on broadcast

* Fix alert styles
This commit is contained in:
Zach Gollwitzer 2025-05-25 08:12:54 -04:00 committed by GitHub
parent c701755b02
commit d21e385962
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 155 additions and 123 deletions

View file

@ -6,6 +6,7 @@ class PlaidItem::WebhookProcessor
@webhook_type = parsed["webhook_type"]
@webhook_code = parsed["webhook_code"]
@item_id = parsed["item_id"]
@error = parsed["error"]
end
def process
@ -21,6 +22,10 @@ class PlaidItem::WebhookProcessor
plaid_item.sync_later
when [ "HOLDINGS", "DEFAULT_UPDATE" ]
plaid_item.sync_later
when [ "ITEM", "ERROR" ]
if error["error_code"] == "ITEM_LOGIN_REQUIRED"
plaid_item.update!(status: :requires_update)
end
else
Rails.logger.warn("Unhandled Plaid webhook type: #{webhook_type}:#{webhook_code}")
end
@ -30,7 +35,7 @@ class PlaidItem::WebhookProcessor
end
private
attr_reader :webhook_type, :webhook_code, :item_id
attr_reader :webhook_type, :webhook_code, :item_id, :error
def plaid_item
@plaid_item ||= PlaidItem.find_by(plaid_id: item_id)