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

Social | Restore must_reauth as connection status #40946

Conversation

manzoorwanijk
Copy link
Member

When we brought connections management to wp-admin, we set the connection status only to 'ok' or 'broken'. Then, in #40539, we made changes to the front-end logic to remove the usage of must_reauth status.

It seems like we will still need that must_reauth status for LinkedIn connections.

Proposed changes:

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Goto connections management
  • Ensure that the connections are marked as healthy (not broken)
  • Break a connection
    • For Mastodon, remove Jetpack here.
    • For Facebook, remove Jetpack here.
  • Confirm that the broken connections in the editor are marked as such and the notices appear.
  • I am not sure how to test the must_reauth status.

Copy link
Contributor

github-actions bot commented Jan 10, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the update/social-add-back-must_reauth-as-connection-status branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/social-add-back-must_reauth-as-connection-status
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!

must_reauth means that the connection will break soon, but it still
works. We'll display an appropriate notice.
Copy link
Contributor

@pablinos pablinos left a 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 for me. I made a minor tweak so that must_reauth connections aren't disabled.

It's not for this PR, but we need to fix the notices we're displaying.

CleanShot 2025-01-10 at 17 23 17@2x

The LinkedIn one is inline and links to Calypso, and the list of broken connections is too verbose for me. In this instance my test site still has a twitter connection that makes matters worse.

We should probably swap back to a more general message that we replaced in #38450 and put more description in the modal. We could also put the connection icon in a different state. Perhaps with an additional icon or colour change.

@manzoorwanijk manzoorwanijk merged commit b1f7eb4 into social/unified-connections-management Jan 10, 2025
56 checks passed
@manzoorwanijk manzoorwanijk deleted the update/social-add-back-must_reauth-as-connection-status branch January 10, 2025 17:41
manzoorwanijk added a commit that referenced this pull request Jan 21, 2025
* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Social: Connections API schema front end changes (#40539)

* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Update connect-form.tsx

* Create connections class for caching

* Update types for connection object

* Update connection actions to reflect new types

* Mark 'id' as deprecated

* Add changelog

* Deprecated fields should be optional

* Fix TS error

* Update unit tests

* Replace/remove deprecated props usage

* Remove unused code

* Fix connection selectors

* Fix unit tests

* Reduce the number of changes

* Fix type

* Oops! It should be negation

* Restore class-connections.php

* Social | Add site context for publicize endpoints (#40704)

* Allow requests as blog in base controller

* Add filters for connections controller

* Add changelog

* Update baseline.php

* Rename the 'include' param to 'scope' for clarity

* Return shared connections by default

* Remove scope parameter in favour of request context

* Only pass test_connections to WPCOM

* Update baseline.php

* Social: Implement connections caching with the updated endpoint (#40892)

* Update connections class to implement caching

* Add get_all_for_user method

* Pass cached connections to initial state

* Invalidate cache on XMLRPC request

* Add changelog

* Remove eager loading of connections following cache invalidation

* Improve clear caching logic to handle race condition

* Social: Replace can_disconnect with a store data selector (#40888)

* Pass the connected users WPCOM data to the UI

* Augment wpcom for user object

* Create canUserManageConnection selector

* Replace can_disconnect with the new selector

* Fix unit tests

* Add changelog

* Fix user data for WPCOM sites

* Fix unit tests

* Add changelog

* Social | Restore must_reauth as connection status (#40946)

* Add "must_reauth" to status in REST schema

* Restore the UI changes to consider must_reauth status

* Add changelog

* Don't disable connections with must_reauth status

must_reauth means that the connection will break soon, but it still
works. We'll display an appropriate notice.

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Social | Clean up connections controller to use connections class (#40982)

* Create Proxy_Requests class for re-usability

* Move is_wpcom utility to Publicize_Utils class

* Move connections specific logic from REST controller to connections class

* Add changelog

* Update baseline.php

* Move publicize permissions check to its own method

* Social | Fix connect button for broken connections (#40995)

* Social | Fix connected accounts not marked as such on confirmation screen (#40997)

* Social | Fix connected accounts not marked as such on confirmation screen

* Add a comment

* Social | Update connections schema to change `user_id` to `wpcom_user_id` (#41025)

* Social | Update connections schema to change user_id to wpcom_user_id

* Fix wpcom_user_id for post connections field

* Add changelog

* Social | Implement the other CRUD operations for connections (#40928)

* WIP

* Pass the connection ID in the URL

* Pass connection_id for delete proxy request

* Allow overriding $request_options

* Clean up debugging

* Add changelog

* Add changelog for js changes

* Fix static analysis issues

* Remove unused code

* Update baseline.php

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Unify changelogs

---------

Co-authored-by: Paul Bunkham <[email protected]>
manzoorwanijk added a commit that referenced this pull request Jan 22, 2025
* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Social: Connections API schema front end changes (#40539)

* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Update connect-form.tsx

* Create connections class for caching

* Update types for connection object

* Update connection actions to reflect new types

* Mark 'id' as deprecated

* Add changelog

* Deprecated fields should be optional

* Fix TS error

* Update unit tests

* Replace/remove deprecated props usage

* Remove unused code

* Fix connection selectors

* Fix unit tests

* Reduce the number of changes

* Fix type

* Oops! It should be negation

* Restore class-connections.php

* Social | Add site context for publicize endpoints (#40704)

* Allow requests as blog in base controller

* Add filters for connections controller

* Add changelog

* Update baseline.php

* Rename the 'include' param to 'scope' for clarity

* Return shared connections by default

* Remove scope parameter in favour of request context

* Only pass test_connections to WPCOM

* Update baseline.php

* Social: Implement connections caching with the updated endpoint (#40892)

* Update connections class to implement caching

* Add get_all_for_user method

* Pass cached connections to initial state

* Invalidate cache on XMLRPC request

* Add changelog

* Remove eager loading of connections following cache invalidation

* Improve clear caching logic to handle race condition

* Social: Replace can_disconnect with a store data selector (#40888)

* Pass the connected users WPCOM data to the UI

* Augment wpcom for user object

* Create canUserManageConnection selector

* Replace can_disconnect with the new selector

* Fix unit tests

* Add changelog

* Fix user data for WPCOM sites

* Fix unit tests

* Add changelog

* Social | Restore must_reauth as connection status (#40946)

* Add "must_reauth" to status in REST schema

* Restore the UI changes to consider must_reauth status

* Add changelog

* Don't disable connections with must_reauth status

must_reauth means that the connection will break soon, but it still
works. We'll display an appropriate notice.

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Social | Clean up connections controller to use connections class (#40982)

* Create Proxy_Requests class for re-usability

* Move is_wpcom utility to Publicize_Utils class

* Move connections specific logic from REST controller to connections class

* Add changelog

* Update baseline.php

* Move publicize permissions check to its own method

* Social | Fix connect button for broken connections (#40995)

* Social | Fix connected accounts not marked as such on confirmation screen (#40997)

* Social | Fix connected accounts not marked as such on confirmation screen

* Add a comment

* Social | Update connections schema to change `user_id` to `wpcom_user_id` (#41025)

* Social | Update connections schema to change user_id to wpcom_user_id

* Fix wpcom_user_id for post connections field

* Add changelog

* Social | Implement the other CRUD operations for connections (#40928)

* WIP

* Pass the connection ID in the URL

* Pass connection_id for delete proxy request

* Allow overriding $request_options

* Clean up debugging

* Add changelog

* Add changelog for js changes

* Fix static analysis issues

* Remove unused code

* Update baseline.php

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Unify changelogs

* Unify js changelog

* It should be 'blog' not 'site'

* Social | Use the proxy trait from connection package (#41087)

* Update baseline.php

* Update phan

* Social | Fix social connections list initial state feature check (#41151)

* Social | Enable connections management for WPCOM sites

---------

Co-authored-by: Paul Bunkham <[email protected]>
coder-karen pushed a commit that referenced this pull request Jan 24, 2025
* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Social: Connections API schema front end changes (#40539)

* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Update connect-form.tsx

* Create connections class for caching

* Update types for connection object

* Update connection actions to reflect new types

* Mark 'id' as deprecated

* Add changelog

* Deprecated fields should be optional

* Fix TS error

* Update unit tests

* Replace/remove deprecated props usage

* Remove unused code

* Fix connection selectors

* Fix unit tests

* Reduce the number of changes

* Fix type

* Oops! It should be negation

* Restore class-connections.php

* Social | Add site context for publicize endpoints (#40704)

* Allow requests as blog in base controller

* Add filters for connections controller

* Add changelog

* Update baseline.php

* Rename the 'include' param to 'scope' for clarity

* Return shared connections by default

* Remove scope parameter in favour of request context

* Only pass test_connections to WPCOM

* Update baseline.php

* Social: Implement connections caching with the updated endpoint (#40892)

* Update connections class to implement caching

* Add get_all_for_user method

* Pass cached connections to initial state

* Invalidate cache on XMLRPC request

* Add changelog

* Remove eager loading of connections following cache invalidation

* Improve clear caching logic to handle race condition

* Social: Replace can_disconnect with a store data selector (#40888)

* Pass the connected users WPCOM data to the UI

* Augment wpcom for user object

* Create canUserManageConnection selector

* Replace can_disconnect with the new selector

* Fix unit tests

* Add changelog

* Fix user data for WPCOM sites

* Fix unit tests

* Add changelog

* Social | Restore must_reauth as connection status (#40946)

* Add "must_reauth" to status in REST schema

* Restore the UI changes to consider must_reauth status

* Add changelog

* Don't disable connections with must_reauth status

must_reauth means that the connection will break soon, but it still
works. We'll display an appropriate notice.

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Social | Clean up connections controller to use connections class (#40982)

* Create Proxy_Requests class for re-usability

* Move is_wpcom utility to Publicize_Utils class

* Move connections specific logic from REST controller to connections class

* Add changelog

* Update baseline.php

* Move publicize permissions check to its own method

* Social | Fix connect button for broken connections (#40995)

* Social | Fix connected accounts not marked as such on confirmation screen (#40997)

* Social | Fix connected accounts not marked as such on confirmation screen

* Add a comment

* Social | Update connections schema to change `user_id` to `wpcom_user_id` (#41025)

* Social | Update connections schema to change user_id to wpcom_user_id

* Fix wpcom_user_id for post connections field

* Add changelog

* Social | Implement the other CRUD operations for connections (#40928)

* WIP

* Pass the connection ID in the URL

* Pass connection_id for delete proxy request

* Allow overriding $request_options

* Clean up debugging

* Add changelog

* Add changelog for js changes

* Fix static analysis issues

* Remove unused code

* Update baseline.php

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Unify changelogs

---------

Co-authored-by: Paul Bunkham <[email protected]>
coder-karen pushed a commit that referenced this pull request Jan 24, 2025
* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Social: Connections API schema front end changes (#40539)

* Social: Use connections REST endpoint for initial state (#40677)

* Create connections class for caching

* Update script data to use connections from the REST endpoint

* changelog

* Restore deprecated connection fields for time being

* Disable caching for now

* Fix display_name for Mastodon

* Remove the unused caching logic

* Update connect-form.tsx

* Create connections class for caching

* Update types for connection object

* Update connection actions to reflect new types

* Mark 'id' as deprecated

* Add changelog

* Deprecated fields should be optional

* Fix TS error

* Update unit tests

* Replace/remove deprecated props usage

* Remove unused code

* Fix connection selectors

* Fix unit tests

* Reduce the number of changes

* Fix type

* Oops! It should be negation

* Restore class-connections.php

* Social | Add site context for publicize endpoints (#40704)

* Allow requests as blog in base controller

* Add filters for connections controller

* Add changelog

* Update baseline.php

* Rename the 'include' param to 'scope' for clarity

* Return shared connections by default

* Remove scope parameter in favour of request context

* Only pass test_connections to WPCOM

* Update baseline.php

* Social: Implement connections caching with the updated endpoint (#40892)

* Update connections class to implement caching

* Add get_all_for_user method

* Pass cached connections to initial state

* Invalidate cache on XMLRPC request

* Add changelog

* Remove eager loading of connections following cache invalidation

* Improve clear caching logic to handle race condition

* Social: Replace can_disconnect with a store data selector (#40888)

* Pass the connected users WPCOM data to the UI

* Augment wpcom for user object

* Create canUserManageConnection selector

* Replace can_disconnect with the new selector

* Fix unit tests

* Add changelog

* Fix user data for WPCOM sites

* Fix unit tests

* Add changelog

* Social | Restore must_reauth as connection status (#40946)

* Add "must_reauth" to status in REST schema

* Restore the UI changes to consider must_reauth status

* Add changelog

* Don't disable connections with must_reauth status

must_reauth means that the connection will break soon, but it still
works. We'll display an appropriate notice.

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Social | Clean up connections controller to use connections class (#40982)

* Create Proxy_Requests class for re-usability

* Move is_wpcom utility to Publicize_Utils class

* Move connections specific logic from REST controller to connections class

* Add changelog

* Update baseline.php

* Move publicize permissions check to its own method

* Social | Fix connect button for broken connections (#40995)

* Social | Fix connected accounts not marked as such on confirmation screen (#40997)

* Social | Fix connected accounts not marked as such on confirmation screen

* Add a comment

* Social | Update connections schema to change `user_id` to `wpcom_user_id` (#41025)

* Social | Update connections schema to change user_id to wpcom_user_id

* Fix wpcom_user_id for post connections field

* Add changelog

* Social | Implement the other CRUD operations for connections (#40928)

* WIP

* Pass the connection ID in the URL

* Pass connection_id for delete proxy request

* Allow overriding $request_options

* Clean up debugging

* Add changelog

* Add changelog for js changes

* Fix static analysis issues

* Remove unused code

* Update baseline.php

---------

Co-authored-by: Paul Bunkham <[email protected]>

* Unify changelogs

* Unify js changelog

* It should be 'blog' not 'site'

* Social | Use the proxy trait from connection package (#41087)

* Update baseline.php

* Update phan

* Social | Fix social connections list initial state feature check (#41151)

* Social | Enable connections management for WPCOM sites

---------

Co-authored-by: Paul Bunkham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants