Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

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

Merged
zachgoll merged 2 commits intomainfrom
1415-bug-editing-any-part-of-a-date-causes-a-page-reload-before-another-edit-can-be-done
Nov 20, 2024
Merged

Don't refresh page when transaction details are edited#1479
zachgoll merged 2 commits intomainfrom
1415-bug-editing-any-part-of-a-date-causes-a-page-reload-before-another-edit-can-be-done

Conversation

@zachgoll
Copy link
Contributor

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
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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