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

Don't refresh page when transaction details are edited #1479

Conversation

zachgoll
Copy link
Collaborator

When users edit transactions or trades, we trigger an "account sync" so that the historical graph and other account details reflect the updates that were made.

The sync process previously triggered a global page refresh when it completed to ensure the user is seeing updated data.

While this PR is not a perfect solution (some parts of the page will require a refresh after editing), it offers a much better user experience while editing individual transactions (while preserving the sync trigger).

Additionally, this provides a more flexible interface for different types of syncs to run code after the sync has succeeded/failed:

  def perform
    start!

    begin
      syncable.sync_data(start_date: start_date)
      complete!
    rescue StandardError => error
      fail! error
      raise error if Rails.env.development?
    ensure
       # Syncable can optionally implement this method to run code after the sync regardless of the sync's outcome
       syncable.post_sync
    end
  end

…diting-any-part-of-a-date-causes-a-page-reload-before-another-edit-can-be-done
@zachgoll zachgoll merged commit e641cfc into main Nov 20, 2024
5 checks passed
@zachgoll zachgoll deleted the 1415-bug-editing-any-part-of-a-date-causes-a-page-reload-before-another-edit-can-be-done branch November 20, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Editing any part of a date causes a page reload before another edit can be done
1 participant