-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Newsletter imports: Handle errors correctly #99162
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~274 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~211 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Hey @spsiddarthan do you mind if I merge #98562? There might be some conflicts. |
Of course - feel free to merge that PR. Thanks for checking in, @allilevine. And going forward with other PRs as well, feel free to merge, I will happy to rebase my PRs whenever I begin work the next day :) |
4b7c7e2
to
c019364
Compare
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.
I rebased and tested (thanks for the CSV tip!) and this is working well. Can we also change the message on the back-end (fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Serfg%2Qncv%2Qcyhtvaf%2Sraqcbvagf%2Sfhofpevoref.cuc%3Se%3Q604q8o54%231072-og)? It has a typo and it's not very informative. Here's the message for the same error in the Substack importer:
![Screen Shot 2025-01-31 at 1 57 27 PM](https://private-user-images.githubusercontent.com/1689238/408698739-9dd88734-53a9-41f9-85cd-0f0d369deba3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjk3MTUsIm5iZiI6MTczOTMyOTQxNSwicGF0aCI6Ii8xNjg5MjM4LzQwODY5ODczOS05ZGQ4ODczNC01M2E5LTQxZjktODVjZC0wZjBkMzY5ZGViYTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMDMwMzM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OThlNzE0Y2U5OTJjMjMxYmFkYjZkYmNjNzNjZGEwMGM1MzE4N2EzYTcwZmNmNjA4MDIzY2M1NzBhMDY2NzBkZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.B7vtBSepuRiNeyBcZ3nXl6adnQ2KcAhoZlIbq5ljOag)
Something like this? "You've reached the 100-email limit on our free plan, so we couldn't import your subscriber list. Upgrade to any paid plan to upload without limits."
Also, what do you think of leaving the notification in place until the user dismisses it? A link to upgrade would also be great, but I'm not sure if we can pass one to a notice. 🤔
Thanks, @allilevine for the rebase and the testing.
I have updated the copy on WPCOM for this. You should see this in a retest when you sandbox 171979-ghe-Automattic/wpcom. ![]()
Good idea, thanks, I have made the change.
It is possible I think, and I took a dig at this, but it quickly became a can of worms for different reasons.
![]() ![]()
![]()
Do you think we can merge this PR for now and return to it after fixing the above issues? I can open a few CANI issues to refactor. |
Q: This email limit is for how many subscribers can be added with 1 file import (and not about total subscribers the site can have)? That is, a user seeing this error can still add more subscribers but just not 100+ at a time? If that is the case, we might consider some rewording of the copy some. It kind of reads to me like the site hit its subscriber limit in general, although still could probably use some tweaks if thats the case too. Im not great with new copies personally, I usually ping Dave when I have to finalize them. |
@spsiddarthan That sounds good to me! Thank you for looking into it 🙌
@Addison-Stavlo It's a general limit, not an import limit. If you already have 100 or more subscribers, and you try to import even one, you'll see an error. There's documentation here: https://wordpress.com/support/import-subscribers-to-a-newsletter/#errors-during-import We can definitely tweak that if it's not clear.
cc @davemart-in for your input 🙂 |
Thanks for the questions and thoughts, @Addison-Stavlo. And, thanks for the answers, @allilevine. I will wait for @davemart-in's input on the copy before merging this PR. Dave, for context, this is the error message we thought we will show when a free user faces the 100 email subscribers limit - |
Let's shorten the message to just:
Could we use the notice component and add an upgrade link? Here's a mockup: |
Thank you!
@davemart-in, I wanted to add an upgrade link as well, but there's an issue with uniquely identifying this limits error, which I explained in this comment. Since this route returns multiple error codes, we'd need to refactor both the front-end and backend to handle it properly. The backend is returning a 200 instead of the 400 errors, but the front-end isn't reading the individual error codes when I make WPCOM return the 400s. I am happy to take the refactor on, it's probably a day's work, but wanted to be sure it's worth doing now. |
Let's proceed with the refactor. Thanks. |
@Addison-Stavlo @allilevine I read this differently, the limit is just how many we allow them to put in themselves. It is not a limit to how many subscribers they can have. I read this in Jetpack - https://jetpack.com/support/newsletter/import-subscribers/#add-up-to-10000-subscribers
I also read it this way in the code comment:
Separately, I don't think we communicate this very well across the documentation. It also reads to me that 10,000 subscribers is all I am allowed to have when I upgrade even though I think that is a per batch limit. |
Got it, so there's a 100 quota on imported subscribers for all time, but a 10k limit on how many people subscribe to the site. That explains why we see free sites with hundreds of subscribers that can't import one or more subscribers. Yeah that's not clear from our documentation. |
Oh wow, thanks for the extra details! That is a little complicated to get a copy out thats 100% accurate to users 🤣... So their site has not hit its limit on subscribers, but the user has hit their limit on how many they can import themselves. Maybe something like |
4ab1136
to
9779d03
Compare
I've updated the PR description to explain the reasoning behnd the changes a bit more. |
|
||
dispatch.importCsvSubscribersStartSuccess( siteId, data.upload_id ); | ||
if ( data.upload_id ) { |
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.
This is the bit where we are handling the response from WPCOM. The else part takes care of the WP_Errors that are returned with a 200 error code.
client/my-sites/subscribers/components/subscribers-page/subscribers-page-context.tsx
Outdated
Show resolved
Hide resolved
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.
This is working well except for an issue with the success notice that I noted on the back-end PR: 171979-ghe-Automattic/wpcom#issuecomment-1043892
66e38bf
to
df3c541
Compare
1964530
to
1978a6b
Compare
Some additional testing that I performed:
|
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.
I tested (while sandboxed): the happy paths, the bug, and Jetpack. I got the correct notices and upgrade links. ✅
Manual imports and CSV imports error handling isn't happening currently, the UI always assumes the imports are successful. This PR fixes it by handling the responses from WPCOM. Keep in mind that you have to sandbox public-api against 171979-ghe-Automattic/wpcom to test this PR.
wpcomProxyRequest
unfortunately considers anything that's not 2xx code as an errror, but doesn't parse the response of the object correctly.Proposed Changes
useImportError
hook to see if the API call to import subscribers returns an error.Why are these changes being made?
Testing Instructions
Happy Case
Testing this bug
Before:
CleanShot.2025-02-05.at.17.22.06.mp4
After:
CleanShot.2025-02-05.at.17.27.48.mp4
Pre-merge Checklist