-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GODT-2582): Do not report errors for duplicate recovered messages
If we fail to append a message that is already in the recovery mailbox, do not create a new sentry report to avoid spam. Note that this simplistic approach does not distinguish between different error sources.
- Loading branch information
1 parent
c0ba09f
commit 47bece3
Showing
4 changed files
with
54 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,6 +238,38 @@ func TestFailedAppendAreDedupedInRecoveryMailbox(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestRecoveryMailboxOnlyReportsOnFirstDedupedMessage(t *testing.T) { | ||
runOneToOneTestClientWithAuth(t, defaultServerOptions(t, withConnectorBuilder(&failAppendLabelConnectorBuilder{})), func(client *client.Client, s *testSession) { | ||
{ | ||
status, err := client.Status(ids.GluonRecoveryMailboxName, []goimap.StatusItem{goimap.StatusMessages}) | ||
require.NoError(t, err) | ||
require.Equal(t, uint32(0), status.Messages) | ||
} | ||
|
||
status, err := client.Select("INBOX", false) | ||
require.NoError(t, err) | ||
require.Equal(t, uint32(0), status.Messages) | ||
require.Error(t, doAppendWithClient(client, "INBOX", "To: [email protected]", time.Now())) | ||
require.Error(t, doAppendWithClient(client, "INBOX", "To: [email protected]", time.Now())) | ||
|
||
{ | ||
status, err := client.Status(ids.GluonRecoveryMailboxName, []goimap.StatusItem{goimap.StatusMessages}) | ||
require.NoError(t, err) | ||
require.Equal(t, uint32(1), status.Messages) | ||
} | ||
{ | ||
status, err := client.Status("INBOX", []goimap.StatusItem{goimap.StatusMessages}) | ||
require.NoError(t, err) | ||
require.Equal(t, uint32(0), status.Messages) | ||
} | ||
|
||
{ | ||
reports := s.reporter.getReports() | ||
require.Equal(t, 1, len(reports)) | ||
} | ||
}) | ||
} | ||
|
||
func TestRecoveryMBoxCanBeCopiedOutOfDedup(t *testing.T) { | ||
runOneToOneTestClientWithAuth(t, defaultServerOptions(t, withConnectorBuilder(&recoveryDedupConnectorConnectorBuilder{})), func(client *client.Client, s *testSession) { | ||
// Insert first message, fails. | ||
|