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

Watch data updates #39

Open
maxceem opened this issue Jun 18, 2021 · 2 comments
Open

Watch data updates #39

maxceem opened this issue Jun 18, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@maxceem
Copy link
Contributor

maxceem commented Jun 18, 2021

At the moment after we process the payment we don't update the data loaded in the table in any way. Though after payment processing it is expected that the statuses of all the payments would be updated to scheduled.

If we just reload the data for the page after payments processing the data returned by the server might be still outdated because such updates take place not immediately.

So I suggest the next solution:

  1. When we process payment for selected items or all records
  2. For all the records for which we processed the payment (if it not failed) we should show a loading indicator, we can replace the payment status label with a label which stays Loading... inside and color 5FB7EE.
  3. The same time in the background we should reload data for the current page (but don't show loading indicator on the whole page). And as soon as we see that paymentStatus which was before changed to in-progres update data for that row (not only status but other values also). This means that the payment for this record is in progress.
  4. We should get reload data with some interval, like 5 seconds (should be configurable) until we see that all success records got updated status.
  5. We should stop reloading data if:
    • we already got all the success records updated on the current page
    • 5 minutes passed (should be configurable) - in such case for all records which weren't updated, show the previous status
    • we make any action like: filter, change, change per page, change data, process another payment or go to another URL

NOTES:

  • When process payment for ALL pages, we only update the data for the current page, we don't have to check status for all the pages as it would be too hard
  • When we process payment inside one page, some payments might fail and we know it, so we don't have to wait for status update for these rows, only wait for status update for the rows which were success
@maxceem
Copy link
Contributor Author

maxceem commented Jun 18, 2021

@MadOPcode please, hold a bit working on this issue, I'm going to make some improvements to this task.

@maxceem maxceem changed the title [$80] Reload data after the payment is processed Watch data updates Jun 18, 2021
@maxceem
Copy link
Contributor Author

maxceem commented Jun 19, 2021

The biggest issue with implementing this issue is that if we have some filter by pyamentStatus applied, and we would like to reload data for the current page, some rows may disappear due to changed status so it's hard to get updated status for all the items on the page with one request and making individual requests for each item feel heavy.

@maxceem maxceem added the enhancement New feature or request label Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant