Skip to content

Conversation

@mattcreaser
Copy link
Member

@mattcreaser mattcreaser commented Oct 10, 2025

Issue #, if available:

Description of changes:
Liveness launches a series of coroutines from the LivenessCoordinator. These were not bound to a controlled coroutine scope, causing the coroutines to potentially outlive the desired lifetime of the Coordinator instance. In particular, the 5 second delay in launchCamera could cause a session error after the LivenessCoordinator was already destroyed.

Updated to hold on to the coroutine scope and cancel when the instance is destroyed.

How did you test these changes?

  • Verified that the timeout is cancelled if the coordinator is destroyed.
  • Verified that resources are cleaned up after the coordinator is destroyed.

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Ensure commit message has the appropriate scope (e.g fix(liveness): message, fix(authenticator): message, fix(all): message)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mattcreaser mattcreaser requested review from a team as code owners October 10, 2025 16:52
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.61%. Comparing base (5168db7) to head (5c8695a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
- Coverage   32.65%   32.61%   -0.05%     
==========================================
  Files         100      100              
  Lines        4621     4627       +6     
  Branches      587      589       +2     
==========================================
  Hits         1509     1509              
- Misses       2956     2962       +6     
  Partials      156      156              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mattcreaser mattcreaser changed the title fix(liveness): LivenessCoordinator uses a proper coroutine scope that cancels on destroy fix(liveness): LivenessCoordinator uses a coroutine scope that cancels on destroy Oct 10, 2025
@ekjotmultani ekjotmultani merged commit 1d1e5a6 into main Oct 10, 2025
5 of 6 checks passed
@ekjotmultani ekjotmultani deleted the mattcreaser/liveness-camera-fix branch October 10, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants