Fix orphaned connections on load

This commit is contained in:
crschnick 2024-07-23 11:45:33 +00:00
parent 167d1c1da2
commit 4f1e6ea5f1
3 changed files with 18 additions and 3 deletions

View file

@ -215,17 +215,26 @@ public class StandardStorage extends DataStorage {
local.setColor(DataStoreColor.BLUE);
}
callProviders();
// Reload stores, this time with all entry refs present
// These do however not have a completed validity yet
refreshEntries();
// Bring entries into completed validity if possible
// Needed for chained stores
refreshEntries();
// Let providers work on complete stores
callProviders();
// Update validaties after any possible changes
refreshEntries();
// Add any possible missing synthetic parents
storeEntriesSet.forEach(entry -> {
var syntheticParent = getSyntheticParent(entry);
syntheticParent.ifPresent(entry1 -> {
addStoreEntryIfNotPresent(entry1);
});
});
// Update validaties from synthetic parent I changes
refreshEntries();
// Save to apply changes
if (!hasFixedLocal) {
storeEntriesSet.removeIf(dataStoreEntry ->
!dataStoreEntry.getUuid().equals(LOCAL_ID) && dataStoreEntry.getStore() instanceof LocalStore);
@ -235,6 +244,7 @@ public class StandardStorage extends DataStorage {
entry.dirty = true;
entry.setStoreNode(JacksonMapper.getDefault().valueToTree(entry.getStore()));
});
// Save to apply changes
save(false);
}

View file

@ -171,7 +171,11 @@ public class AppJacksonModule extends SimpleModule {
// Compatibility fix for legacy local stores
var toUse = e.getStore() instanceof LocalStore ? DataStorage.get().local() : e;
return toUse != null ? new DataStoreEntryRef<>(toUse) : null;
if (toUse == null) {
return null;
}
return new DataStoreEntryRef<>(toUse);
}
}
}

View file

@ -18,6 +18,7 @@
- Add support for VNC RSA-AES authentication schemes, allowing to connect to more types of VNC servers
- Services can now be opened in a browser using either HTTP or HTTPs
- You can now create shortcuts to automatically forward and open services in a browser
- Fix doctor containers in some cases not persisting, leaving invalid orphan connections behind on the bottom
- Improve description for service groups
- Publish API libraries to maven central
- Show warning when launching PowerShell in constrained language mode