Skip to content

Commit bdccd82

Browse files
committed
Remove active stream logic
1 parent 2ea01ff commit bdccd82

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

pkg/code/server/messaging/message_handler.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ type MessageHandler interface {
3333
// allowed to be sent and persisted
3434
Validate(ctx context.Context, rendezvous *common.Account, message *messagingpb.Message) error
3535

36-
// RequiresActiveStream determines whether a message can only be sent if an
37-
// active stream is available. If true, then the message must also provide
38-
// the maximum time it expects the stream to be valid for, which is dependent
39-
// on the use case.
40-
//
41-
// todo: Not implemented for multi-server
42-
RequiresActiveStream() (bool, time.Duration)
43-
4436
// OnSuccess is called upon creating the message after validation
4537
OnSuccess(ctx context.Context) error
4638
}
@@ -80,10 +72,6 @@ func (h *RequestToGrabBillMessageHandler) Validate(ctx context.Context, rendezvo
8072
return nil
8173
}
8274

83-
func (h *RequestToGrabBillMessageHandler) RequiresActiveStream() (bool, time.Duration) {
84-
return true, time.Minute
85-
}
86-
8775
func (h *RequestToGrabBillMessageHandler) OnSuccess(ctx context.Context) error {
8876
return nil
8977
}
@@ -399,10 +387,6 @@ func (h *RequestToReceiveBillMessageHandler) Validate(ctx context.Context, rende
399387
return nil
400388
}
401389

402-
func (h *RequestToReceiveBillMessageHandler) RequiresActiveStream() (bool, time.Duration) {
403-
return false, 0 * time.Minute
404-
}
405-
406390
func (h *RequestToReceiveBillMessageHandler) OnSuccess(ctx context.Context) error {
407391
if h.recordAlreadyExists {
408392
return nil
@@ -458,10 +442,6 @@ func (h *ClientRejectedPaymentMessageHandler) Validate(ctx context.Context, rend
458442
return nil
459443
}
460444

461-
func (h *ClientRejectedPaymentMessageHandler) RequiresActiveStream() (bool, time.Duration) {
462-
return false, 0 * time.Minute
463-
}
464-
465445
func (h *ClientRejectedPaymentMessageHandler) OnSuccess(ctx context.Context) error {
466446
return nil
467447
}
@@ -482,10 +462,6 @@ func (h *CodeScannedMessageHandler) Validate(ctx context.Context, rendezvous *co
482462
return nil
483463
}
484464

485-
func (h *CodeScannedMessageHandler) RequiresActiveStream() (bool, time.Duration) {
486-
return false, 0 * time.Minute
487-
}
488-
489465
func (h *CodeScannedMessageHandler) OnSuccess(ctx context.Context) error {
490466
return nil
491467
}

pkg/code/server/messaging/testutil.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,6 @@ func (c *sendMessageCallMetadata) assertPermissionDeniedError(t *testing.T, mess
505505
assert.True(t, strings.Contains(strings.ToLower(status.Message()), strings.ToLower(message)))
506506
}
507507

508-
func (c *sendMessageCallMetadata) assertNoActiveStreamError(t *testing.T) {
509-
require.NoError(t, c.err)
510-
require.Equal(t, messagingpb.SendMessageResponse_NO_ACTIVE_STREAM, c.resp.Result)
511-
}
512-
513508
func (c *clientEnv) sendRequestToGrabBillMessage(t *testing.T, rendezvousKey *common.Account) *sendMessageCallMetadata {
514509
destination := testutil.NewRandomAccount(t)
515510

0 commit comments

Comments
 (0)