-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FBE: Use of recommended delete connection endpoint over delete permis…
…sion endpoint (#2844) Summary: ### Changes proposed in this Pull Request: **Problem:** 1. The Delete Permission User API only removed Meta connection assets from the WooCommerce database, leaving asset-related data enabled on Meta surfaces. 2. If a user disconnected the connection before uninstalling assets from Meta surfaces using Managed Connection; the UI for Managed Connection was also removed, making it difficult for users to uninstall this feature from Meta surface. **Solution:** 1. Replaced the Delete Permission User API with the recommended Delete FBE Connection endpoint, which uninstalls assets from Meta surfaces and removes their permissions. 2. Removed the Managed Connection UI button for uninstalling FBE from Meta surfaces, as the Delete Connection endpoint now handles this functionality. ### Screenshots: **Before:** <img width="784" alt="image" src="https://github.com/user-attachments/assets/76bf6364-2af8-4657-a043-8e79aaff99c6"> **After:** <img width="803" alt="image" src="https://github.com/user-attachments/assets/45e7ebc8-4a74-4589-a9e3-0e4fff1f4f20"> ![Screenshot 2025-02-04 at 15 29 54](https://github.com/user-attachments/assets/77e02cba-ca89-42f9-a016-85c50e4b02fc) <img width="797" alt="image" src="https://github.com/user-attachments/assets/f4d215b0-0959-4ee8-8347-16c64afe3460"> ### Detailed test instructions: 1. Run new tests: `./vendor/bin/phpunit --filter test_delete_mbe_connection_deletes_user_permission_request` 2. Run all tests : `npm run test:php` 3. Lint: `./vendor/bin/phpcs` 4. Manual testing: I have tested new Disconnect UI flow; it uninstall FBE connection from WooCommerce as well as from Meta surface ### Changelog entry - **Removed:** Delete Permission User API - **Added:** Delete FBE Connection endpoint to uninstall assets from Meta surfaces and remove permissions - **Removed:** Managed Connection UI button for uninstalling FBE from Meta surfaces (now handled by Delete Connection endpoint) Pull Request resolved: #2844 Reviewed By: halilozanakgul Differential Revision: D68972713 Pulled By: atuld123 fbshipit-source-id: b19ee8351b4852c69192449f9af2644960a55307
- Loading branch information
1 parent
f7a6c3b
commit 4be2987
Showing
8 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @package FacebookCommerce | ||
*/ | ||
|
||
namespace WooCommerce\Facebook\API\FBE\Installation\Delete; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
use WooCommerce\Facebook\API\FBE\Installation; | ||
|
||
/** | ||
* FBE installation API delete request object. | ||
* | ||
* @since 3.3.3 | ||
*/ | ||
class Request extends Installation\Request { | ||
/** | ||
* API request constructor. | ||
* | ||
* @since 3.3.3 | ||
* | ||
* @param string $external_business_id external business_id | ||
*/ | ||
public function __construct( $external_business_id ) { | ||
// include the business ID in the request body | ||
parent::__construct( 'fbe_installs', 'DELETE' ); | ||
$this->data['fbe_external_business_id'] = $external_business_id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
declare( strict_types=1 ); | ||
|
||
namespace WooCommerce\Facebook\API\FBE\Installation\Delete; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
use WooCommerce\Facebook\API; | ||
|
||
/** | ||
* FBE Installation API delete response object. | ||
*/ | ||
class Response extends API\Response {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters