Skip to content

Commit

Permalink
Handle delete events during portal create sleep
Browse files Browse the repository at this point in the history
Probably fixes #7
  • Loading branch information
tulir committed Aug 25, 2023
1 parent 612fb2b commit 5767138
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ func (user *User) syncConversation(v *gmproto.Conversation, source string) {
if cancel := portal.cancelCreation.Load(); cancel != nil {
if updateType == gmproto.ConversationStatus_SPAM_FOLDER || updateType == gmproto.ConversationStatus_BLOCKED_FOLDER {
(*cancel)(fmt.Errorf("conversation was moved to spam"))
} else if updateType == gmproto.ConversationStatus_DELETED {
(*cancel)(fmt.Errorf("conversation was deleted"))
portal.Delete()
} else {
log.Debug().Msg("Conversation creation is still pending, ignoring new sync event")
return
Expand Down

0 comments on commit 5767138

Please sign in to comment.