Skip to content

Commit 5cb471c

Browse files
tajchertclaude
andcommitted
Fix TOTP code freeze when adding new items in Authenticator
Use SharingStarted.Eagerly for per-item StateFlows to prevent them from stopping emissions when the combined flow changes. This fixes an issue where adding a new TOTP code would cause existing codes to freeze permanently because WhileSubscribed() with no timeout immediately stops flows when subscribers change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent e306c06 commit 5cb471c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

authenticator/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/manager/TotpCodeManagerImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class TotpCodeManagerImpl @Inject constructor(
8383
}
8484
.stateIn(
8585
scope = itemScope,
86-
started = SharingStarted.WhileSubscribed(),
86+
started = SharingStarted.Eagerly,
8787
initialValue = null,
8888
)
8989
}

0 commit comments

Comments
 (0)