Handle account record the same as other records when reading storage
This commit is contained in:
parent
145962597c
commit
87016f6ecf
@ -58,16 +58,12 @@ public class StorageHelper {
|
|||||||
|
|
||||||
account.setStorageManifestVersion(manifest.get().getVersion());
|
account.setStorageManifestVersion(manifest.get().getVersion());
|
||||||
|
|
||||||
readAccountRecord(manifest.get());
|
final var storageIds = manifest.get().getStorageIds().stream().filter(id -> !id.isUnknown()).toList();
|
||||||
|
|
||||||
final var storageIds = manifest.get()
|
|
||||||
.getStorageIds()
|
|
||||||
.stream()
|
|
||||||
.filter(id -> !id.isUnknown() && id.getType() != ManifestRecord.Identifier.Type.ACCOUNT_VALUE)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
for (final var record : getSignalStorageRecords(storageIds)) {
|
for (final var record : getSignalStorageRecords(storageIds)) {
|
||||||
if (record.getType() == ManifestRecord.Identifier.Type.GROUPV2_VALUE) {
|
if (record.getType() == ManifestRecord.Identifier.Type.ACCOUNT_VALUE) {
|
||||||
|
readAccountRecord(record);
|
||||||
|
} else if (record.getType() == ManifestRecord.Identifier.Type.GROUPV2_VALUE) {
|
||||||
readGroupV2Record(record);
|
readGroupV2Record(record);
|
||||||
} else if (record.getType() == ManifestRecord.Identifier.Type.GROUPV1_VALUE) {
|
} else if (record.getType() == ManifestRecord.Identifier.Type.GROUPV1_VALUE) {
|
||||||
readGroupV1Record(record);
|
readGroupV1Record(record);
|
||||||
@ -174,14 +170,7 @@ public class StorageHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readAccountRecord(final SignalStorageManifest manifest) throws IOException {
|
private void readAccountRecord(final SignalStorageRecord record) throws IOException {
|
||||||
Optional<StorageId> accountId = manifest.getAccountStorageId();
|
|
||||||
if (accountId.isEmpty()) {
|
|
||||||
logger.warn("Manifest has no account record, ignoring.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SignalStorageRecord record = getSignalStorageRecord(accountId.get());
|
|
||||||
if (record == null) {
|
if (record == null) {
|
||||||
logger.warn("Could not find account record, even though we had an ID, ignoring.");
|
logger.warn("Could not find account record, even though we had an ID, ignoring.");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user