Skip to content

Commit

Permalink
Disable event send retries
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Oct 17, 2024
1 parent eca143f commit f7eee76
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions includes/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
18 changes: 18 additions & 0 deletions tests/phpunit/includes/EventManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f7eee76

Please sign in to comment.