Jetpack: Blog subscriptions should inform of pending confirmations

Created on 27 Feb 2014  路  12Comments  路  Source: Automattic/jetpack

When subscribing to a blog you are informed that a confirmation email has been sent, but this is only sent the first time, and if you miss it you are left waiting for a never-arriving e-mail.

Ideally, notify the user that they already have a pending subscription awaiting confirmation, or time out the request after a given time period and allow a new one to be sent.

As it stands, the notice you receive when trying to sign up with an already confirmed address looks like it would be better suited for this. (The notification css could also do with some love, no padding or anything, it's quite cramped, see below)
subsribe

FixTheFlows Subscriptions Touches WP.com Files [Pri] High [Status] Needs Design [Type] Bug [Type] Happiness Request

Most helpful comment

Some notes when I try to find a way to fix this issue.

First and most importantly, we have not had different and proper statuses to fix this issue

I put a debugging code below this line to catch up $responses from WP.com.

https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L475

        $responses = $xml->getResponse(); //current line 475

        /*** htdat debugging code **/
        $htdat_debug = var_export( $responses, true);

        $htdat_log_name = "LOG: query response from WP.com \r\n";

        error_log( $htdat_log_name . $htdat_debug);

        // End htdat debugging code

In both cases, (1) a new email tries to subscribe to a site, and (2) this email subscribes to this site again, $responses is giving the same error status pending - that is equal to the success message. Related code: https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L499-L500

We may need to distinguish these two cases with two different statuses like WP.com.
WP.com is handling code https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions/views.php#L164-L200 is doing this well:

  • confirming (for case 1 above)
  • pending (for case 2)

For A12s, more info about WP.com codebase in 23699-pb .

Second, pending status is confusing

  1. Current error handling code is mixing "active" and "pending". We may need to decouple them?
    https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L567-L570
            case 'active':
            case 'pending':
                $result = 'already';
                break;
  1. Even so, pending status is converted to true in Jetpack_Subscriptions::subscribe(). So the pending handling with active in the switch above can not be reached?

https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L489-L505

            switch ( $response[0]['status'] ) {
            case 'error' :
                $r[] = new Jetpack_Error( 'not_subscribed' );
                continue 2;
            case 'disabled' :
                $r[] = new Jetpack_Error( 'disabled' );
                continue 2;
            case 'active' :
                $r[] = new Jetpack_Error( 'active' );
                continue 2;
            case 'pending' :
                $r[] = true;
                continue 2;
            default :
                $r[] = new Jetpack_Error( 'unknown_status', (string) $response[0]['status'] );
                continue 2;
            }

All 12 comments

Yep, that's an annoying issue we're aware of, and should get fixed.

Related: 4782-wpcom

Related: #2278

2648893-t

Confirmed this is still an issue. We likely don't even need to display it in red as an error, but simply display an alternate message like:

image

Not sure if same issue, but on an AT site, re-subscribing with (non-verified) email address does not result in an error message, but repeated success messages when attempting to re-subscribe with the same address. This persisted across different browsers and privacy windows, as well as after clearing the browser cache.

Came up also in 2446331-zen. Extra context at 22dde-pb.

Also in 2474441-zen

2558374-zen

Some notes when I try to find a way to fix this issue.

First and most importantly, we have not had different and proper statuses to fix this issue

I put a debugging code below this line to catch up $responses from WP.com.

https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L475

        $responses = $xml->getResponse(); //current line 475

        /*** htdat debugging code **/
        $htdat_debug = var_export( $responses, true);

        $htdat_log_name = "LOG: query response from WP.com \r\n";

        error_log( $htdat_log_name . $htdat_debug);

        // End htdat debugging code

In both cases, (1) a new email tries to subscribe to a site, and (2) this email subscribes to this site again, $responses is giving the same error status pending - that is equal to the success message. Related code: https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L499-L500

We may need to distinguish these two cases with two different statuses like WP.com.
WP.com is handling code https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions/views.php#L164-L200 is doing this well:

  • confirming (for case 1 above)
  • pending (for case 2)

For A12s, more info about WP.com codebase in 23699-pb .

Second, pending status is confusing

  1. Current error handling code is mixing "active" and "pending". We may need to decouple them?
    https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L567-L570
            case 'active':
            case 'pending':
                $result = 'already';
                break;
  1. Even so, pending status is converted to true in Jetpack_Subscriptions::subscribe(). So the pending handling with active in the switch above can not be reached?

https://github.com/Automattic/jetpack/blob/8.0/modules/subscriptions.php#L489-L505

            switch ( $response[0]['status'] ) {
            case 'error' :
                $r[] = new Jetpack_Error( 'not_subscribed' );
                continue 2;
            case 'disabled' :
                $r[] = new Jetpack_Error( 'disabled' );
                continue 2;
            case 'active' :
                $r[] = new Jetpack_Error( 'active' );
                continue 2;
            case 'pending' :
                $r[] = true;
                continue 2;
            default :
                $r[] = new Jetpack_Error( 'unknown_status', (string) $response[0]['status'] );
                continue 2;
            }
Was this page helpful?
0 / 5 - 0 ratings