Skip to content

Conversation

Copy link

Copilot AI commented Nov 10, 2025

Applied review feedback to eliminate potential race condition in authentication state checking.

Changes

  • Replace cached currentUserId variable with direct Firebase auth access: Changed LaunchedEffect to call Firebase.auth.currentUser?.uid directly instead of using the currentUserId variable captured in onCreate. The cached variable could be stale if auth state changes between assignment and usage.
// Before
val currentUserId = Firebase.auth.currentUser?.uid
// ... later in LaunchedEffect
if (currentUserId == null && navController?.currentDestination?.route != Screen.SignIn.route) {

// After
// ... in LaunchedEffect
if (Firebase.auth.currentUser?.uid == null && navController?.currentDestination?.route != Screen.SignIn.route) {

This ensures the auth state is checked at the time of use, providing thread-safe authentication validation.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: maxschwinghammer <111356450+maxschwinghammer@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 10, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/agents/gradle-instrumentation-agent-8.13.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.13 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix null-safe Firebase auth handling Use direct Firebase auth check to avoid race conditions Nov 10, 2025
Copilot finished work on behalf of maxschwinghammer November 10, 2025 08:10
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