From f7eee763475c735f869564f57e79e3bd213c6fb9 Mon Sep 17 00:00:00 2001 From: Brian Henry Date: Wed, 16 Oct 2024 17:20:39 -0700 Subject: [PATCH] Disable event send retries --- includes/EventManager.php | 7 +++++++ tests/phpunit/includes/EventManagerTest.php | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/includes/EventManager.php b/includes/EventManager.php index c4b40d7..8c0f9eb 100644 --- a/includes/EventManager.php +++ b/includes/EventManager.php @@ -211,6 +211,9 @@ protected function send_request_events( array $events ): void { */ $response = $subscriber->notify( $events ); + // Due to an unidentified bug causing events to be resent, we are temporarily disabling retries. + continue; + if ( ! ( $subscriber instanceof HiiveConnection ) ) { continue; } @@ -260,6 +263,10 @@ public function send_saved_events_batch(): void { */ $response = $subscriber->notify( $events ); + // Due to an unidentified bug causing events to be resent, we are temporarily disabling retries. + $queue->remove( array_keys( $events ) ); + continue; + if ( ! ( $subscriber instanceof HiiveConnection ) ) { continue; } diff --git a/tests/phpunit/includes/EventManagerTest.php b/tests/phpunit/includes/EventManagerTest.php index d90c77d..5e277c3 100644 --- a/tests/phpunit/includes/EventManagerTest.php +++ b/tests/phpunit/includes/EventManagerTest.php @@ -157,6 +157,8 @@ public function test_init(): void { */ public function test_send_saved_events_happy_path(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $batch_queue_mock = Mockery::mock( BatchQueue::class ); \Patchwork\redefine( @@ -225,6 +227,8 @@ function () use ( $batch_queue_mock ) { */ public function test_send_saved_events_happy_path_no_failed_events(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $batch_queue_mock = Mockery::mock( BatchQueue::class ); \Patchwork\redefine( @@ -292,6 +296,8 @@ function () use ( $batch_queue_mock ) { */ public function test_send_saved_events_happy_path_no_successful_events(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $batch_queue_mock = Mockery::mock( BatchQueue::class ); \Patchwork\redefine( @@ -359,6 +365,8 @@ function () use ( $batch_queue_mock ) { */ public function test_send_saved_events_wp_error_from_hiive_connection(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $batch_queue_mock = Mockery::mock( BatchQueue::class ); \Patchwork\redefine( @@ -420,6 +428,8 @@ function () use ( $batch_queue_mock ) { */ public function test_send_saved_events_failures_from_hiive(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $batch_queue_mock = Mockery::mock( BatchQueue::class ); \Patchwork\redefine( @@ -487,6 +497,8 @@ function () use ( $batch_queue_mock ) { */ public function test_shutdown_happy_path_no_failed_events(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $sut = new EventManager(); $event = Mockery::mock( Event::class )->makePartial(); @@ -537,6 +549,8 @@ function () use ( $batch_queue_mock ) { */ public function test_shutdown_happy_path_with_failed_events(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $sut = new EventManager(); $event = Mockery::mock( Event::class )->makePartial(); @@ -588,6 +602,8 @@ function () use ( $batch_queue_mock ) { */ public function test_shutdown_hiive_connection_wp_error(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $sut = new EventManager(); $event = Mockery::mock( Event::class )->makePartial(); @@ -634,6 +650,8 @@ function () use ( $batch_queue_mock ) { */ public function test_shutdown_hiive_500_error(): void { + $this->markTestSkipped( 'Due to an unidentified bug causing events to be resent, we are temporarily disabling retries.' ); + $sut = new EventManager(); $event = Mockery::mock( Event::class )->makePartial();