fix(#539): finish the CookieSyncManager removal by calling CookieManager.flush()#1350
Draft
jim-daf wants to merge 1 commit intoQuantumBadger:masterfrom
Draft
Conversation
…ng CookieManager.flush()
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.
Closes #539.
Context
Issue #539 reported that
CookieSyncManageris deprecated since API 21 and is no longer required. The legacy call is already gone from master, but the modern half of the contract is still missing. The Android docs make the new pattern explicit:Without that call the recently issued
removeAllCookies()request is only queued and may be lost when the fragment tears down its WebView and the OS later reclaims the process.Fix
Add the explicit
flush()call insideWebViewFragment.onDestroyView()so the cookie store is durably written before the fragment finishes destruction. A short comment records the rationale so future contributors do not reintroduceCookieSyncManager.Validation
onDestroyView()block.flush()has been part of the WebView public API since API 21, which matches the project's existingminSdkVersion.