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

[Rollouts] Set active rollout metadata after activating config #12316

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

ddnan
Copy link
Contributor

@ddnan ddnan commented Jan 25, 2024

Set active rollout metadata after activate config.
Add last active template version to userDefault.

Looks like the previous PR is getting bigger, split this part into a PR for better review. Notifying interop logic will be in a following PR.

Note: this change will merge to our feature branch not master
#no-changelog

@ddnan ddnan marked this pull request as ready for review January 25, 2024 01:33
@@ -329,6 +329,8 @@ - (void)activateWithCompletion:(FIRRemoteConfigActivateChangeCompletion)completi
// New config has been activated at this point
FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000069", @"Config activated.");
[strongSelf->_configContent activatePersonalization];
[strongSelf->_settings updateLastActiveTemplateVersion];
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking: We don't need to wait for this to complete before calling activateRolloutMetadata since UserDefaults is updated synchronously in the process (and persisted to disk async) so rollouts will get the latest value in the process https://developer.apple.com/documentation/foundation/userdefaults#overview

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense to me. Dispatch the activeTemplateVersion updating.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I was saying I think that the previous code (synchronously) is fine, since UserDefaults is updated in the process synchronously. Can revisit this when we use the value in a subsequent PR, though

@ddnan ddnan requested a review from danasilver January 29, 2024 18:23
@ddnan ddnan merged commit ecefe80 into featureRollouts Jan 30, 2024
67 of 68 checks passed
@ddnan ddnan deleted the ddn-active-rollout branch January 30, 2024 19:37
@firebase firebase locked and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants