mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 06:21:23 +00:00
fix: Enable Banking DNS issues and provide better UI sync feedback (#1021)
* fix(docker): add explicit DNS config to fix enable banking sync * fix(enable-banking): surface sync errors in the UI * fix: add spaces inside array brackets for RuboCop * fix(enable-banking): surface sync errors and partial failures in UI
This commit is contained in:
@@ -15,6 +15,7 @@ module EnableBankingItems
|
||||
@enable_banking_unlinked_count_map ||= {}
|
||||
@enable_banking_duplicate_only_map ||= {}
|
||||
@enable_banking_show_relink_map ||= {}
|
||||
@enable_banking_latest_sync_error_map ||= {}
|
||||
|
||||
# Batch-check if ANY family has manual accounts (same result for all items from same family)
|
||||
family_ids = items.map { |i| i.family_id }.uniq
|
||||
@@ -42,6 +43,7 @@ module EnableBankingItems
|
||||
end
|
||||
stats = (latest_sync&.sync_stats || {})
|
||||
@enable_banking_sync_stats_map[item.id] = stats
|
||||
@enable_banking_latest_sync_error_map[item.id] = latest_sync&.error
|
||||
|
||||
# Whether the family has any manual accounts available to link (from batch query)
|
||||
@enable_banking_has_unlinked_map[item.id] = families_with_manuals.include?(item.family_id)
|
||||
@@ -68,13 +70,6 @@ module EnableBankingItems
|
||||
@enable_banking_show_relink_map[item.id] = false
|
||||
end
|
||||
end
|
||||
|
||||
# Ensure maps are hashes even when items empty
|
||||
@enable_banking_sync_stats_map ||= {}
|
||||
@enable_banking_has_unlinked_map ||= {}
|
||||
@enable_banking_unlinked_count_map ||= {}
|
||||
@enable_banking_duplicate_only_map ||= {}
|
||||
@enable_banking_show_relink_map ||= {}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user