From 629483eef9936d24d81a054c68bc0ea9b58a918b Mon Sep 17 00:00:00 2001 From: Picorims Date: Thu, 30 Oct 2025 16:49:49 +0100 Subject: [PATCH 1/3] Add troubleshooting information for persisted-scope Add information regarding the importance of plug-in initialization order in order for this plug-in to work properly. --- src/content/docs/plugin/persisted-scope.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/content/docs/plugin/persisted-scope.mdx b/src/content/docs/plugin/persisted-scope.mdx index 9e932fa3cd..890b170c2a 100644 --- a/src/content/docs/plugin/persisted-scope.mdx +++ b/src/content/docs/plugin/persisted-scope.mdx @@ -69,3 +69,11 @@ Install the persisted-scope plugin to get started. ## Usage After setup the plugin will automatically save and restore filesystem and asset scopes. + +## Troubleshooting + +If the plug-in does not seem to save the scope, make sure that this plug-in is initialized AFTER the fs plug-in. If it is not the case, you should see a warning message upon launching your app in dev mode, similar to this: + +``` +Please make sure to register the `fs` plugin before the `persisted-scope` plugin! +``` From d3d0bb3b87956ed4ffeb3af3d6216f5b6ca67da2 Mon Sep 17 00:00:00 2001 From: Picorims Date: Tue, 4 Nov 2025 23:53:09 +0100 Subject: [PATCH 2/3] use warn aside in setup of persisted scope to document plugin order --- src/content/docs/plugin/persisted-scope.mdx | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/content/docs/plugin/persisted-scope.mdx b/src/content/docs/plugin/persisted-scope.mdx index 890b170c2a..1af0cb78fe 100644 --- a/src/content/docs/plugin/persisted-scope.mdx +++ b/src/content/docs/plugin/persisted-scope.mdx @@ -66,14 +66,27 @@ Install the persisted-scope plugin to get started. -## Usage - -After setup the plugin will automatically save and restore filesystem and asset scopes. - -## Troubleshooting +:::caution +The `persisted-scope` plugin *must* be registered and initialized after the `fs` plugin, as illustrated by the example below: + +```rs +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_fs::init()) // fs MUST BE before persisted scope! + .plugin(tauri_plugin_persisted_scope::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} +``` -If the plug-in does not seem to save the scope, make sure that this plug-in is initialized AFTER the fs plug-in. If it is not the case, you should see a warning message upon launching your app in dev mode, similar to this: +**Not doing so will result in the persisted scope not working!** You should also see a warning message upon launching your app in dev mode, similar to this: ``` Please make sure to register the `fs` plugin before the `persisted-scope` plugin! ``` +::: + +## Usage + +After setup the plugin will automatically save and restore filesystem and asset scopes. From 6b11fb0ea9caf2a30a3fdfaca938759129692bb3 Mon Sep 17 00:00:00 2001 From: Ayres Vitor Date: Tue, 4 Nov 2025 20:56:53 -0300 Subject: [PATCH 3/3] format --- src/content/docs/plugin/persisted-scope.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/docs/plugin/persisted-scope.mdx b/src/content/docs/plugin/persisted-scope.mdx index 1af0cb78fe..e342dfe7f2 100644 --- a/src/content/docs/plugin/persisted-scope.mdx +++ b/src/content/docs/plugin/persisted-scope.mdx @@ -67,7 +67,7 @@ Install the persisted-scope plugin to get started. :::caution -The `persisted-scope` plugin *must* be registered and initialized after the `fs` plugin, as illustrated by the example below: +The `persisted-scope` plugin _must_ be registered and initialized after the `fs` plugin, as illustrated by the example below: ```rs #[cfg_attr(mobile, tauri::mobile_entry_point)] @@ -85,6 +85,7 @@ pub fn run() { ``` Please make sure to register the `fs` plugin before the `persisted-scope` plugin! ``` + ::: ## Usage