-
Notifications
You must be signed in to change notification settings - Fork 68
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
Transactions: Use server based export for both sync download on browser and async email export #10049
Conversation
server export instead of using CSV export.
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +95 B (0%) Total Size: 1.36 MB
ℹ️ View Unchanged
|
I did a manual test on the transactions page with less than 25 transactions filtered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌟 Very nice @jessy-p! I prefer this approach to removing client-side download completely.
We can implement server-side logic to significantly increase the client-side download row-count limit higher than 25-100 (10,000? 1,000,000?). We can test server performance to find where this limit should be → when async export is required.
I think this would offer a better UX for most flows, with the existing email-based flow remaining in place for very large and slow exports.
Definitely! But I think we can focus on matching it with pagesize (25-100) currently, so that it adheres to the existing and Core UX principles, which seems to be:
|
The PR here achieves good parity with the existing UX flow and in my opinion, can be merged as it is. We can bump up the limit to 100 safely. We can create a separate issue / spike to explore what is the safe highest number for the sync, and incrementally deliver it later. WDYT? |
- Parameter is set from component - Pass parameter to endpoint.
For fixing issue with download on Safari Co-authored-by: Eric Jinks <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an interim review, while we make sure https://github.com/Automattic/transact-platform-server/pull/7077 will work (see that PR discussion), this is working well when running against local server on trunk
or sandbox on trunk
.
I've left some minor code comments and updated some falling JS tests in 899f809.
const path = addQueryArgs( `${ NAMESPACE }/transactions/download`, { | ||
...formatQueryFilters( query ), | ||
download_type: query.downloadType, | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, download_type: query.downloadType
can be placed within formatQueryFilters
which is conducting the same type of operation on other filter params.
recordEvent( 'wcpay_transactions_download_csv_click', { | ||
location: props.depositId ? 'deposit_details' : 'transactions', | ||
download_type: downloadType, | ||
exported_transactions: rows.length, | ||
total_transactions: transactionsSummary.count, | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 Rather than remove, should we expand the event prop download_type
with sync
and async
for tracking purposes?
@@ -432,12 +432,13 @@ public function get_fraud_outcome_transactions_export( $request ) { | |||
* @param string $user_email The email to search for. | |||
* @param string $deposit_id The deposit to filter on. | |||
* @param string $locale Site locale. | |||
* @param string $download_type The type of download to perform. | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 It may be worth listing the possible values to clarify what this param is for.
* | |
* @param string $download_type The type of download to perform: 'sync' or 'async'. |
# Conflicts: # client/transactions/list/index.tsx
# Conflicts: # client/transactions/list/test/index.tsx
As part of testing this PR, let's check to see if the columns currently exported via client are also available via server export. As reported in #8183, there are discrepancies between columns exported via server/client-based CSV export, (the Update – this is being handled in a separate PR https://github.com/Automattic/transact-platform-server/pull/7142 ✅ |
Closing this PR as we are going with #10211 |
Alternative approach for #9969
Changes proposed in this Pull Request
In this PR, the UX for browser download remains the same, but the backend implementation is changed so that the server export is used for generating the CSV which is made available immediately. This approach does NOT change the UX for merchant (i.e. download is available immediately for single page export), but it solves the overhead and issues of maintaining multiple implementations that do not match.
Single page downloads are available immediately, multiple page downloads (i.e. number of rows to be exported > Page size ) the download is emailed.
The corresponding server changes are on https://github.com/Automattic/transact-platform-server/pull/7077.
NOTE:
Testing instructions
Test 1:
Test 2:
Test 3:
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge