Skip to content

Commit

Permalink
Persistent settings reliability fix (#3512)
Browse files Browse the repository at this point in the history
Forces a write to always happen when settings are validated. Call to
PendingWrite doesn't by itself do that, if there were no changes
pending.

b/305057554
  • Loading branch information
kaidokert authored Jun 10, 2024
1 parent ac7111d commit 5ecc2c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cobalt/persistent_storage/persistent_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ void PersistentSettings::Validate() {
return;
}
validated_initial_settings_ = true;
// Report a dummy value as "dirty", so that commit actually writes
pref_store_->ReportValueChanged("", 0);
pref_store_->CommitPendingWrite();
}

Expand Down

0 comments on commit 5ecc2c8

Please sign in to comment.