google-nomulus/java/google/registry/flows
nickfelt 3a7f67b7f3 Fix DomainTransferRequestFlow to correctly cancel autorenew graces
This fixes longstanding bug b/19430703 in which domain transfers that were
server-approved would only handle the autorenew grace period correctly if
the autorenew grace period was going to start within the transfer window.
If the autorenew grace period was already active (e.g. the domain had
recently autorenewed, before the transfer was requested), the logic would
miss it, even if it was going to be active throughout the transfer window
(i.e. it would still be active at the server-approval time).

When the autorenew grace period is active at the time a transfer is approved
(whether by the server or explicitly via DomainTransferApproveFlow), the
correct behavior is to essentially "cancel" the autorenew - the losing registrar
receives a refund for the autorenew charge, and the gaining registrar's transfer
extended registration years are applied to the expiration time as it was prior
to that autorenew.  The way we implement this is that we just have the transfer
essentially "subsume" the autorenew - we deduct 1 year from the transfer's
extended registration years before extending the registration period from what
the expiration time is post-autorenew at the moment of transfer approval.

See b/19430703#comment17 for details on the policy justification; the only real
ICANN document about this is https://www.icann.org/news/advisory-2002-06-06-en,
but registrars informally document in many places that transfers will trigger
autorenew grace, e.g. see https://support.google.com/domains/answer/3251236

There are still a few parts of this bug that remain unfixed:

  1) RdeDomainImportAction repeats a lot of logic when handling imported domains
     that are in pending transfer, so it will also need to address this case in
     some way, but the policy choices there are unclear so I'm waiting until we
     know more about RDE import goals to figure out how to fix that.

  2) Behavior at the millisecond edge cases is inconsistent - specifically, for
     the case where a transfer is requested such that the automatic transfer
     time is exactly the domain's expiration time (down to the millisecond),
     the correct behavior is a little unclear and this CL for now ignores this
     issue in favor of getting a fix for 99.999% of the issue into prod.  See
     newly created b/35881941 for the gory details.

Also, there are parts of this bug that will be fixed as parts of either
b/25084229 (transfer exDate computations) or b/35110537 (disallowing transfers
with extended registration years other than 1), both of which are less pressing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149024269
2017-03-07 13:39:15 -05:00
..
async Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
contact Remove unnecessary filter on LINKED 2017-02-02 16:41:39 -05:00
custom Fix an annoying Javadoc nit 2017-02-02 16:47:28 -05:00
domain Fix DomainTransferRequestFlow to correctly cancel autorenew graces 2017-03-07 13:39:15 -05:00
exceptions Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
host Remove duplicate version of lookupSuperordinateDomain() function 2017-03-07 13:12:09 -05:00
picker Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
poll Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
session Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
soy Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
BUILD Restructure Maven dependencies in build 2017-01-09 11:59:04 -05:00
CheckApiAction.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppConsoleAction.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppController.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppException.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppMetrics.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppRequestHandler.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppRequestSource.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppTlsAction.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppToolAction.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppXmlTransformer.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ExtensionManager.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
Flow.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowComponent.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowModule.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowRunner.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowScope.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowUtils.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
GaeUserCredentials.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
HttpSessionMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
PasswordOnlyTransportCredentials.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ResourceFlowUtils.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
SessionMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
StatelessRequestSessionMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
TlsCredentials.java Fix a deprecated method now that we are on Guava 20 2017-02-02 16:50:20 -05:00
TransactionalFlow.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
TransportCredentials.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00