Skip to content

Fix stale lens removal after cancelled apply#9

Merged
msilivonik-sc merged 2 commits into
mainfrom
codex/fix-use-apply-lens-stale-remove
Jun 23, 2026
Merged

Fix stale lens removal after cancelled apply#9
msilivonik-sc merged 2 commits into
mainfrom
codex/fix-use-apply-lens-stale-remove

Conversation

@msilivonik-sc

Copy link
Copy Markdown
Collaborator

Summary

  • Stop useApplyLens from calling removeLens() again when a cancelled applyLens() resolves later
  • Keep cleanup-time removeLens() intact for unmounts / lens intent changes
  • Add regression coverage for a superseded lens apply resolving after a newer lens has started

Why

Camera Kit core already handles apply/replace ordering. The React wrapper was issuing a second stale removeLens() after an old cancelled apply resolved, which could clear the newer active lens during fast lens switching.

Test Plan

  • npm test -- useApplyLens.test.ts --runInBand
  • npm run typecheck
  • npm run format:check
  • npm test -- --runInBand

@msilivonik-sc msilivonik-sc requested a review from ttaallll June 23, 2026 14:56
@msilivonik-sc msilivonik-sc merged commit 84959eb into main Jun 23, 2026
1 check passed
@msilivonik-sc msilivonik-sc deleted the codex/fix-use-apply-lens-stale-remove branch June 23, 2026 15:09
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.

2 participants