Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global account sync message, integrate with family sync flow #596

Open
zachgoll opened this issue Apr 3, 2024 · 0 comments
Open

Add global account sync message, integrate with family sync flow #596

zachgoll opened this issue Apr 3, 2024 · 0 comments
Labels
💡 Improvement Improvements to an existing feature or flow

Comments

@zachgoll
Copy link
Collaborator

zachgoll commented Apr 3, 2024

#585 covered a general flow around triggering account syncs and keeping track of the last account sync. This issue is for displaying a global sync message when one or more accounts are syncing.

See the sync method on Account below for context:

def sync
update!(status: "syncing")
sync_exchange_rates
calculator = Account::Balance::Calculator.new(self)
calculator.calculate
self.balances.upsert_all(calculator.daily_balances, unique_by: :index_account_balances_on_account_id_date_currency_unique)
self.balances.where("date < ?", effective_start_date).delete_all
update!(status: "ok")
rescue => e
update!(status: "error")
Rails.logger.error("Failed to sync account #{id}: #{e.message}")
end

Requirements

  • Remove sync_message partial and all code that references / renders it. This was originally built as a placeholder.
  • Trigger a global notification on either of the following events:
    • A single account sync starts (additional account sync events will be appended as separate notifications)
    • A "family sync" (all accounts at once) starts
  • Notification is persistent until the sync completes. At completion, it is updated to a success or failure notification.

CleanShot 2024-04-02 at 17 59 06

CleanShot 2024-04-02 at 18 01 08

  • Syncing notification should not interfere with other notifications (if accounts are syncing and user performs an action that triggers a notification, that notification should "stack" underneath the accounts syncing message, which persists until accounts are done syncing)
  • Ideally, notifications are triggered directly from the account sync background jobs via Turbo streams

Considerations

Designs

The following designs show the "family sync" notification flow. Individual account syncs should use the following messages:

  • In-progress: "Syncing [account name]"
  • Complete: "[account name] sync completed" or "[account name] sync failed"

https://www.figma.com/file/lonJmVk3HYkwZoIO7xYP2w/Maybe-App-(Community)?type=design&node-id=2566-134&mode=design&t=PEYkBK1qYR1Yhw8p-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Improvement Improvements to an existing feature or flow
Projects
None yet
Development

No branches or pull requests

1 participant