Repository navigation
[Remote Config] Add EnsureInitialized automated test and make ConfigInfo.UnixEpochUtc static readonly - #1581
Open
AustinBenoit wants to merge 3 commits into
Open
AustinBenoit wants to merge 3 commits into
AustinBenoit wants to merge 3 commits into
Conversation
…MaxValue (UTC) Paired with firebase/firebase-cpp-sdk#1997 (and #1481). - Replace UnixEpochUtc.AddMilliseconds(ulong) in ConfigInfo.cs with tick-exact FromUnixEpochMilliseconds(ulong) clamping to DateTime.MaxValue (UTC), preventing ArgumentOutOfRangeException and double rounding overflow at the DateTime.MaxValue boundary. - Add TestEnsureInitialized to Remote Config UIHandlerAutomated.cs verifying EnsureInitializedAsync() and Info return non-null UTC timestamps. - Add release note under ### Upcoming Release in docs/readme.md.
Contributor
There was a problem hiding this comment.
Code Review
This pull request prevents ArgumentOutOfRangeException on out-of-range timestamps by clamping ConfigInfo.FetchTime and ConfigInfo.ThrottledEndTime to DateTime.MaxValue (UTC). It also adds an automated test to verify that these properties are correctly initialized with UTC kind. The feedback suggests adding a defensive null check for configInfoInternal in the ConfigInfo constructor to prevent a potential NullReferenceException.
Match the repository's existing UnixEpochUtc.AddMilliseconds convention (StorageMetadata, AppCheckToken, UserMetadata) while keeping the MaxUnixEpochMilliseconds -> MaxDateTimeUtc guard. Every integer in [0, 253402300799999] is exact in IEEE-754 double (< 2^53).
…st and static readonly UnixEpochUtc Let firebase/firebase-cpp-sdk#1998 fix the underlying Android uninitialized ConfigInfo::throttled_end_time bug at the root rather than clamping in C#, keeping ConfigInfo consistent with StorageMetadata, AppCheckToken, UserMetadata, and IdTokenResult.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Paired with firebase/firebase-cpp-sdk#1998 (which fixes firebase/firebase-cpp-sdk#1997 and the underlying Android root cause of #1481).
Summary of changes:
remote_config/testapp/Assets/Firebase/Sample/RemoteConfig/UIHandlerAutomated.cs: AddedTestEnsureInitializedverifying that bothEnsureInitializedAsync()andInforeturn non-nullConfigInfoinstances withDateTimeKind.Utctimestamps.remote_config/src/ConfigInfo.cs: MadeUnixEpochUtcstatic readonly(matchingStorageMetadata,AppCheckToken,UserMetadata, andIdTokenResult).Testing
firebase_remote_config_cs(Firebase.RemoteConfig.dll) against the paired C++ PR branch: 0SWIGTYPE_p_leaks, 0 compiler warnings.UIHandler.cs,UIHandlerAutomated.cs, andAutomatedTestRunner.csagainst the builtFirebase.RemoteConfig.dll: 0 errors, 0 warnings.Type of Change
Place an
xin the applicable box: