Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataconnect: auth code internal cleanup #6836

Merged
merged 7 commits into from
Apr 8, 2025

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Apr 4, 2025

This PR refactors and cleans up some of the code related to FirebaseAuth. The changes should have no effects whatsoever on users of the Firebase Data Connect Android Kotlin SDK.

Copy link
Contributor

github-actions bot commented Apr 4, 2025

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

Copy link
Contributor

github-actions bot commented Apr 4, 2025

Test Results

   66 files     66 suites   1m 18s ⏱️
  552 tests   551 ✅ 1 💤 0 ❌
1 104 runs  1 102 ✅ 2 💤 0 ❌

Results for commit 12358d9.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 4, 2025

Coverage Report 1

Affected Products

  • firebase-dataconnect

    Overall coverage changed from ? (9a07498) to 14.45% (606beba) by ?.

    62 individual files with coverage change

    FilenameBase (9a07498)Merge (606beba)Diff
    AlphanumericStringUtil.kt?0.00%?
    AnyValue.kt?0.00%?
    AnyValueSerializer.kt?0.00%?
    Comparisons.kt?0.00%?
    ConnectorConfig.kt?33.33%?
    CoroutineExceptionHandler.kt?50.00%?
    DataConnectAppCheck.kt?71.43%?
    DataConnectAuth.kt?71.43%?
    DataConnectCredentialsTokenManager.kt?34.12%?
    DataConnectException.kt?0.00%?
    DataConnectGrpcClient.kt?0.00%?
    DataConnectGrpcMetadata.kt?65.82%?
    DataConnectGrpcRPCs.kt?0.00%?
    DataConnectOperationException.kt?0.00%?
    DataConnectOperationFailureResponse.kt?0.00%?
    DataConnectOperationFailureResponseImpl.kt?0.00%?
    DataConnectPathSegment.kt?0.00%?
    DataConnectSettings.kt?33.33%?
    DataConnectUntypedData.kt?0.00%?
    DataConnectUntypedVariables.kt?0.00%?
    Emitters.kt?100.00%?
    ExperimentalFirebaseDataConnect.kt?0.00%?
    FirebaseDataConnect.kt?50.00%?
    FirebaseDataConnectFactory.kt?29.17%?
    FirebaseDataConnectImpl.kt?42.34%?
    FirebaseDataConnectRegistrar.kt?100.00%?
    GeneratedConnector.kt?0.00%?
    GeneratedMutation.kt?0.00%?
    GeneratedOperation.kt?0.00%?
    GeneratedQuery.kt?0.00%?
    Globals.kt?0.00%?
    JavaTimeLocalDateSerializer.kt?0.00%?
    KotlinxDatetimeLocalDateSerializer.kt?0.00%?
    LiveQueries.kt?0.00%?
    LiveQuery.kt?0.00%?
    LocalDate.kt?0.00%?
    LocalDateSerializer.kt?0.00%?
    Logger.kt?73.68%?
    LogLevel.kt?72.73%?
    MutationRef.kt?0.00%?
    MutationRefImpl.kt?12.36%?
    NullableReference.kt?40.00%?
    NullOutputStream.kt?0.00%?
    OperationRef.kt?0.00%?
    OperationRefImpl.kt?20.45%?
    OptionalVariable.kt?0.00%?
    ProtoStructDecoder.kt?0.00%?
    ProtoStructEncoder.kt?0.00%?
    ProtoUtil.kt?0.00%?
    QueryManager.kt?0.00%?
    QueryRef.kt?0.00%?
    QueryRefImpl.kt?14.08%?
    QuerySubscription.kt?0.00%?
    QuerySubscriptionImpl.kt?0.00%?
    QuerySubscriptionInternal.kt?0.00%?
    ReferenceCounted.kt?0.00%?
    RegisteredDataDeserialzer.kt?0.00%?
    SafeCollector.common.kt?66.67%?
    SequencedReference.kt?0.00%?
    SuspendingLazy.kt?31.58%?
    TimestampSerializer.kt?0.00%?
    UUIDSerializer.kt?0.00%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/IdBWtpbF0V.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 4, 2025

Size Report 1

Affected Products

  • base

    TypeBase (9a07498)Merge (606beba)Diff
    apk (aggressive)?8.80 kB? (?)
    apk (release)?9.77 kB? (?)
  • firebase-dataconnect

    TypeBase (9a07498)Merge (606beba)Diff
    aar?709 kB? (?)
    apk (aggressive)?440 kB? (?)
    apk (release)?10.0 MB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/xwgzU11Ous.html

@dconeybe dconeybe marked this pull request as ready for review April 4, 2025 17:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/core/DataConnectGrpcClient.kt:105

  • Removing the suspend modifier from retryOnGrpcUnauthenticatedError could cause issues if the passed block requires suspension. Please verify that all invocations of this function do not expect suspend behavior.
private inline fun <T, R> T.retryOnGrpcUnauthenticatedError(

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/core/DataConnectCredentialsTokenManager.kt:190

  • Using compareAndSet on a MutableStateFlow may not work as expected, since MutableStateFlow does not offer a standard compareAndSet API. Consider using the update() method to safely modify state.
if (state.compareAndSet(oldState, State.Closed)) {

@dconeybe dconeybe merged commit dbf5d01 into main Apr 8, 2025
40 of 42 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/AuthCodeCleanup branch April 8, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants