mirror of
https://github.com/google/nomulus
synced 2026-02-04 12:02:30 +00:00
Make async flow logic handle missing client transaction IDs
Per EPP RFC 5730, the <clTRID> element is optional. However, we weren't handling it not being specified in asynchronous contact/host deletions because we were adding it directly as a parameter value on a task, which does not allow null and thus threw a NullPointerException. This fixes handling for nulls (the parameter isn't set at all) and adds a test. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=194123259
This commit is contained in:
@@ -134,7 +134,7 @@ final class AllocateDomainCommand extends MutatingEppToolCommand {
|
||||
"Could not find any history entries for domain application %s",
|
||||
application.getRepoId());
|
||||
String clientTransactionId =
|
||||
emptyToNull(history.getTrid().getClientTransactionId());
|
||||
emptyToNull(history.getTrid().getClientTransactionId().orElse(null));
|
||||
Period period = checkNotNull(extractPeriodFromXml(history.getXmlBytes()));
|
||||
checkArgument(period.getUnit() == Period.Unit.YEARS);
|
||||
ImmutableMap.Builder<String, String> contactsMapBuilder =
|
||||
|
||||
@@ -77,7 +77,7 @@ final class GetHistoryEntriesCommand implements RemoteApiCommand {
|
||||
"Client: %s\nTime: %s\nClient TRID: %s\nServer TRID: %s\n%s\n",
|
||||
entry.getClientId(),
|
||||
entry.getModificationTime(),
|
||||
(entry.getTrid() == null) ? null : entry.getTrid().getClientTransactionId(),
|
||||
(entry.getTrid() == null) ? null : entry.getTrid().getClientTransactionId().orElse(null),
|
||||
(entry.getTrid() == null) ? null : entry.getTrid().getServerTransactionId(),
|
||||
entry.getXmlBytes() == null
|
||||
? String.format("[no XML stored for %s]\n", entry.getType())
|
||||
|
||||
Reference in New Issue
Block a user