1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

[PM-17562] Add strict delay support for RabbitMQ; Refactor implementation (#5899)

* [PM-17562] Add strict delay support for RabbitMQ

* fix lint error

* Added more robust FailureReason handling and some additional tests

* Fix two issues noted by SonarQube

* Fix typo; Add alternate handling if MessageId is null or empty

* Set MessageId on all message publishers
This commit is contained in:
Brant DeBow
2025-06-03 10:48:24 -04:00
committed by GitHub
parent 8165651285
commit 59f5fafb87
44 changed files with 1554 additions and 573 deletions

View File

@ -79,6 +79,7 @@ public class WebhookIntegrationHandlerTests
Assert.Equal(result.Message, message);
Assert.True(result.DelayUntilDate.HasValue);
Assert.InRange(result.DelayUntilDate.Value, DateTime.UtcNow.AddSeconds(59), DateTime.UtcNow.AddSeconds(61));
Assert.Equal("Too Many Requests", result.FailureReason);
}
[Theory, BitAutoData]
@ -99,6 +100,7 @@ public class WebhookIntegrationHandlerTests
Assert.Equal(result.Message, message);
Assert.True(result.DelayUntilDate.HasValue);
Assert.InRange(result.DelayUntilDate.Value, DateTime.UtcNow.AddSeconds(59), DateTime.UtcNow.AddSeconds(61));
Assert.Equal("Too Many Requests", result.FailureReason);
}
[Theory, BitAutoData]
@ -117,6 +119,7 @@ public class WebhookIntegrationHandlerTests
Assert.True(result.Retryable);
Assert.Equal(result.Message, message);
Assert.False(result.DelayUntilDate.HasValue);
Assert.Equal("Internal Server Error", result.FailureReason);
}
[Theory, BitAutoData]
@ -135,5 +138,6 @@ public class WebhookIntegrationHandlerTests
Assert.False(result.Retryable);
Assert.Equal(result.Message, message);
Assert.Null(result.DelayUntilDate);
Assert.Equal("Temporary Redirect", result.FailureReason);
}
}