Skip to content

Commit

Permalink
Add comments for why we do not reset state when we return busy from C…
Browse files Browse the repository at this point in the history
…onfigure State
  • Loading branch information
nivi-apple committed Feb 24, 2023
1 parent b23b0ed commit b9faa4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -680,13 +680,17 @@ bool GetPeerNodeInfo(CommandHandler * commandHandler, const ConcreteCommandPath
response.delayedActionTime.SetValue(delegateResponse.delayedActionTime.ValueOr(kDelayedActionTimeSeconds));
handler->AddResponse(cachedCommandPath, response);
handle.Release();
// We do not reset state when we get the busy error because that means we are locked in a BDX transfer
// session with another requestor when we get this query image request. We do not want to interrupt the
// ongoing transfer instead just respond to the second requestor with a busy status and a delayedActionTime
// in which the requestor can retry.
return;
}
LogErrorOnFailure(err);
handler->AddStatus(cachedCommandPath, StatusIB(err).mStatus);
handle.Release();
// We need to reset state here to clean up any initialization we might have done including starting the timer
// while preparing for transfer if any failure occurs afterwards.
// We need to reset state here to clean up any initialization we might have done including starting the BDX
// timeout timer while preparing for transfer if any failure occurs afterwards.
gOtaSender.ResetState();
return;
}
Expand Down

0 comments on commit b9faa4e

Please sign in to comment.