Skip to content

Commit 57fefc5

Browse files
authored
fix(rustffi): reject empty disconnect lists (#5107)
## Summary - reject empty address lists in the Rust FFI disconnect wrapper before per-address dispatch - return the same `addresses cannot be empty` validation error expected from other clients - complete the peer-info acceptance coverage for [sourcenetwork/defradb.rs#1261](sourcenetwork/defradb.rs#1261) and [sourcenetwork/defradb.rs#1257](sourcenetwork/defradb.rs#1257) ## Verification - [x] `TestNetInfoDisconnectEmptyList` - [x] `net/info`: 7 passed, 0 failed - [x] `net/simple/replicator`: 29 passed, 0 failed - [x] `gofmt` - [x] `git diff --check`
1 parent 6755b55 commit 57fefc5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/clients/rustffi/wrapper.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,9 @@ func (w *Wrapper) Disconnect(
20512051
addresses []string,
20522052
opts ...options.Enumerable[options.DisconnectOptions],
20532053
) error {
2054+
if len(addresses) == 0 {
2055+
return fmt.Errorf("addresses cannot be empty")
2056+
}
20542057
opt := utils.NewOptions(opts...)
20552058
identityDID := identityDIDFromOption(opt.GetIdentity())
20562059

0 commit comments

Comments
 (0)