Change setPersistenceEnabled to async function#18014
Change setPersistenceEnabled to async function#18014omedkane wants to merge 1 commit intofirebase:mainfrom
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Description
This pull request updates the
setPersistenceEnabledmethod in theMethodChannelDatabaseclass to be asynchronous, ensuring that the persistence setting is fully applied before continuing. This change improves the reliability and consistency of enabling or disabling persistence.setPersistenceEnabledinMethodChannelDatabasefrom a synchronousvoidmethod to an asynchronousFuture<void>method, and now properly awaits the underlying platform call.In Android, when application reloads calling setPersistenceEnabled in the main function it causes a error saying it should called only once and before any reference, and there's no way to catch that error because it is a synchronous method calling an async method which throws the error.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?