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

[MBL-774] Use Cleaner Remote Config FetchAndActivate Approach #1819

Merged
merged 12 commits into from May 17, 2023

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented May 10, 2023

📲 What

  • In order for the users to see changes to our Remote Config flags on first, or next, app launch we need to use RC's fetchAndActivate(_ completion:...) method.
  • Our Alpha GoogleServices-Info.plist file needed to be replaced as well because RC requires that Real Time API be enabled in Google Cloud Services which updates the Firebase Project.

🤔 Why

Our implementation now activates previously cached values before fetching. This causes the newly fetched values to be cached for the next launch instead of being applied immediately.

🛠 How

Lets add the fetchAndComplete type signature to RemoteConfigClientType

func fetchAndActivate(completionHandler: ((RemoteConfigFetchAndActivateStatus, Error?) -> Void)?)

Then, we can replace the .fetch and .activate calls.

@scottkicks scottkicks self-assigned this May 10, 2023
@scottkicks scottkicks added this to the release-5.8.0 milestone May 10, 2023
@scottkicks scottkicks marked this pull request as ready for review May 11, 2023 15:40
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #1819 (b3b28c9) into main (6a48e5a) will decrease coverage by 0.01%.
The diff coverage is 70.00%.

❗ Current head b3b28c9 differs from pull request most recent head 04a2aee. Consider uploading reports for the commit 04a2aee to get more accurate results

@@            Coverage Diff             @@
##             main    #1819      +/-   ##
==========================================
- Coverage   84.46%   84.45%   -0.01%     
==========================================
  Files        1283     1283              
  Lines      116641   116650       +9     
  Branches    30947    30953       +6     
==========================================
+ Hits        98516    98521       +5     
- Misses      17047    17052       +5     
+ Partials     1078     1077       -1     
Impacted Files Coverage Δ
Library/MockRemoteConfigClient.swift 42.85% <0.00%> (-3.30%) ⬇️
Library/RemoteConfig/RemoteConfigClientType.swift 100.00% <ø> (ø)
Library/RemoteConfig/RemoteConfligClient.swift 0.00% <0.00%> (ø)
...Models/RemoteConfigFeatureFlagToolsViewModel.swift 82.45% <100.00%> (+4.02%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@scottkicks scottkicks changed the title [No Ticket] Activate Remote Config Values When Config Listener Receives Updates [No Ticket] Use Cleaner Remote Config FetchAndActivate Approach May 17, 2023
@scottkicks scottkicks requested a review from msadoon May 17, 2023 15:38
Copy link
Contributor

@msadoon msadoon left a comment

Choose a reason for hiding this comment

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

good to go!

@scottkicks scottkicks changed the title [No Ticket] Use Cleaner Remote Config FetchAndActivate Approach [MBL-774] Use Cleaner Remote Config FetchAndActivate Approach May 17, 2023
@scottkicks scottkicks merged commit aee3831 into main May 17, 2023
5 checks passed
@scottkicks scottkicks deleted the scott/remote-config-listener-update branch May 17, 2023 16:50
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.

None yet

2 participants