fix: sync scoped connection and outbox exclusion updates
This commit is contained in:
parent
aa21bd04e1
commit
cbccd6a8d9
58 changed files with 919 additions and 1435 deletions
31
internal/store/postgres/dispatch_outbox_exclusion_test.go
Normal file
31
internal/store/postgres/dispatch_outbox_exclusion_test.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package postgres
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"telesrv/internal/store/postgres/sqlcgen"
|
||||
)
|
||||
|
||||
func TestEnqueueDispatchRejectsHalfExclusionPair(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
authKeyID int64
|
||||
sessionID int64
|
||||
}{
|
||||
{name: "auth key only", authKeyID: 1},
|
||||
{name: "session only", sessionID: 1},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
err := enqueueDispatch(context.Background(), nil, sqlcgen.EnqueueDispatchParams{
|
||||
ExcludeAuthKeyID: test.authKeyID,
|
||||
ExcludeSessionID: test.sessionID,
|
||||
})
|
||||
if !errors.Is(err, errInvalidDispatchOutboxExclusionPair) {
|
||||
t.Fatalf("enqueueDispatch error = %v, want %v", err, errInvalidDispatchOutboxExclusionPair)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue