Cancel gaia pairing on phone too if HTTP requests is canceled
This commit is contained in:
parent
074ad64773
commit
4add3fb896
1 changed files with 7 additions and 0 deletions
|
@ -322,6 +322,13 @@ func (c *Client) DoGaiaPairing(ctx context.Context, emojiCallback func(string))
|
||||||
emojiCallback(pairingEmoji)
|
emojiCallback(pairingEmoji)
|
||||||
finishResp, err := c.sendGaiaPairingMessage(ctx, ps, gmproto.ActionType_CREATE_GAIA_PAIRING_CLIENT_FINISHED, clientFinish)
|
finishResp, err := c.sendGaiaPairingMessage(ctx, ps, gmproto.ActionType_CREATE_GAIA_PAIRING_CLIENT_FINISHED, clientFinish)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.Is(err, context.Canceled) {
|
||||||
|
zerolog.Ctx(ctx).Debug().Msg("Sending gaia pairing cancel after context was canceled")
|
||||||
|
cancelErr := c.cancelGaiaPairing(ps)
|
||||||
|
if cancelErr != nil {
|
||||||
|
zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to send gaia pairing cancel request after context was canceled")
|
||||||
|
}
|
||||||
|
}
|
||||||
return fmt.Errorf("failed to send client finish: %w", err)
|
return fmt.Errorf("failed to send client finish: %w", err)
|
||||||
}
|
}
|
||||||
if finishResp.GetFinishErrorType() != 0 {
|
if finishResp.GetFinishErrorType() != 0 {
|
||||||
|
|
Loading…
Reference in a new issue