@@ -55,28 +55,28 @@ func (d *DebugOutput) Report(msg string, args ...any) {
5555 d .Debug ("Errorf: Unable to report error to chat, errReportConv: %v, kbc: %v" ,
5656 d .config .ErrReportConv , d .config .KBC )
5757 } else {
58- if err := SendByConvNameOrID (d .config .KBC , d , d .config .ErrReportConv , msg , args ... ); err != nil && ! IsDeletedConvError (err ) {
58+ if err := SendByConvNameOrID (d .config .KBC , d , d .config .ErrReportConv , msg , args ... ); err != nil && ! IsIgnoredSendError (err ) {
5959 d .Debug ("Errorf: failed to send error message: %s" , err )
6060 }
6161 }
6262}
6363
6464func (d * DebugOutput ) ChatDebug (convID chat1.ConvIDStr , msg string , args ... any ) {
6565 d .Debug (msg , args ... )
66- if _ , err := d .config .KBC .SendMessageByConvID (convID , "Something went wrong!" ); err != nil && ! IsDeletedConvError (err ) {
66+ if _ , err := d .config .KBC .SendMessageByConvID (convID , "Something went wrong!" ); err != nil && ! IsIgnoredSendError (err ) {
6767 d .Errorf ("ChatDebug: failed to send error message: %s" , err )
6868 }
6969}
7070
7171func (d * DebugOutput ) ChatErrorf (convID chat1.ConvIDStr , msg string , args ... any ) {
7272 d .Errorf (msg , args ... )
73- if _ , err := d .config .KBC .SendMessageByConvID (convID , "Something went wrong!" ); err != nil && ! IsDeletedConvError (err ) {
73+ if _ , err := d .config .KBC .SendMessageByConvID (convID , "Something went wrong!" ); err != nil && ! IsIgnoredSendError (err ) {
7474 d .Errorf ("ChatErrorf: failed to send error message: %s" , err )
7575 }
7676}
7777
7878func (d * DebugOutput ) ChatEcho (convID chat1.ConvIDStr , msg string , args ... any ) {
79- if _ , err := d .config .KBC .SendMessageByConvID (convID , msg , args ... ); err != nil && ! IsDeletedConvError (err ) {
79+ if _ , err := d .config .KBC .SendMessageByConvID (convID , msg , args ... ); err != nil && ! IsIgnoredSendError (err ) {
8080 d .Errorf ("ChatEcho: failed to send echo message: %s" , err )
8181 }
8282}
@@ -90,9 +90,20 @@ func (d *DebugOutput) Trace(err *error, format string, args ...any) func() {
9090 }
9191}
9292
93+ func IsIgnoredSendError (err error ) bool {
94+ return IsDeletedConvError (err ) || IsEphemeralKeyError (err )
95+ }
96+
9397func IsDeletedConvError (err error ) bool {
9498 // error created in https://github.com/keybase/client/blob/1985b18c4e7659bede1d4a2e68e4f68467acebc6/go/client/chat_svc_handler.go#L1407
9599 // error created in https://github.com/keybase/keybase/blob/9a82c96231ea2c6132532002e58bac80849265e6/go/chatbase/storage/sql_chat.go#L2324
96100 return strings .Contains (err .Error (), "no conversations matched" ) ||
97101 strings .Contains (err .Error (), "GetConvTriple called with unknown ConversationID" )
98102}
103+
104+ func IsEphemeralKeyError (err error ) bool {
105+ msg := err .Error ()
106+ return strings .Contains (msg , "unboxing teambotEK@generation:" ) ||
107+ strings .Contains (msg , "missing userEK@generation:" ) ||
108+ strings .Contains (msg , "Missing box for teambotEK@generation:" )
109+ }
0 commit comments