fix(store): apply_pending_auto_save can deadlock (#3572)

This commit is contained in:
Tony
2026-09-16 10:49:36 +08:00
committed by GitHub
parent 0850317b5c
commit c050e073b6
2 changed files with 8 additions and 1 deletions
@@ -0,0 +1,6 @@
---
"store": patch
"store-js": patch
---
Fix `apply_pending_auto_save` can deadlock the store
+2 -1
View File
@@ -600,7 +600,8 @@ impl<R: Runtime> Store<R> {
fn apply_pending_auto_save(&self) {
// Cancel and save if auto save is pending
if let Some(sender) = self.auto_save_debounce_sender.lock().unwrap().take() {
let auto_save_debounce_sender = self.auto_save_debounce_sender.lock().unwrap().take();
if let Some(sender) = auto_save_debounce_sender {
let _ = sender.send(AutoSaveMessage::Cancel);
let _ = self.save();
};