mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 02:36:03 +02:00
Filter missing dsData digests during replay (#1439)
This is a result of bad data (we should never allow a null digest) and we'll need to fix that separately, but this allows us to not fail on this during replay
This commit is contained in:
parent
7af9531d52
commit
a46907df0e
2 changed files with 4 additions and 0 deletions
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
package google.registry.model.domain;
|
package google.registry.model.domain;
|
||||||
|
|
||||||
|
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||||
|
|
||||||
import com.googlecode.objectify.Key;
|
import com.googlecode.objectify.Key;
|
||||||
import google.registry.model.EppResource;
|
import google.registry.model.EppResource;
|
||||||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||||
|
@ -168,6 +170,7 @@ public class DomainBase extends DomainContent
|
||||||
@Override
|
@Override
|
||||||
public void beforeSqlSaveOnReplay() {
|
public void beforeSqlSaveOnReplay() {
|
||||||
fullyQualifiedDomainName = DomainNameUtils.canonicalizeDomainName(fullyQualifiedDomainName);
|
fullyQualifiedDomainName = DomainNameUtils.canonicalizeDomainName(fullyQualifiedDomainName);
|
||||||
|
dsData = dsData.stream().filter(datum -> datum.getDigest() != null).collect(toImmutableSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -317,6 +317,7 @@ public class DomainHistory extends HistoryEntry implements SqlEntity {
|
||||||
domainHistory.nsHosts = nullToEmptyImmutableCopy(domainHistory.domainContent.nsHosts);
|
domainHistory.nsHosts = nullToEmptyImmutableCopy(domainHistory.domainContent.nsHosts);
|
||||||
domainHistory.dsDataHistories =
|
domainHistory.dsDataHistories =
|
||||||
nullToEmptyImmutableCopy(domainHistory.domainContent.getDsData()).stream()
|
nullToEmptyImmutableCopy(domainHistory.domainContent.getDsData()).stream()
|
||||||
|
.filter(dsData -> dsData.getDigest() != null)
|
||||||
.map(dsData -> DomainDsDataHistory.createFrom(domainHistory.id, dsData))
|
.map(dsData -> DomainDsDataHistory.createFrom(domainHistory.id, dsData))
|
||||||
.collect(toImmutableSet());
|
.collect(toImmutableSet());
|
||||||
domainHistory.gracePeriodHistories =
|
domainHistory.gracePeriodHistories =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue