Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/com/team2813/AllPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ static synchronized void migrateLegacyPreferences() {
}
}

// Preferences installs a listener that makes all new topics persistent, so these values can be
// written even if we explicitly marked them as not persistent. Delete them to avoid possible
// exceptions from PersistedConfiguration.
//
// For a long-term fix, see https://github.com/Prospect-Robotics/lib2813/pull/58.
for (var key : Preferences.getKeys()) {
if (key.endsWith(".registeredTo")) {
Preferences.remove(key);
}
}

migrateDrivePreferences(
DRIVE_BOOLEAN_PREFERENCE_KEYS, AllPreferences::booleanPreferenceMigrator);
migrateDrivePreferences(DRIVE_DOUBLE_PREFERENCE_KEYS, AllPreferences::doublePreferenceMigrator);
Expand Down