Ver a proveniência

do not cache notification responses when system time has been changed (for example in a test)

tags/v0.1.8
Jonathan Cobb há 5 anos
ascendente
cometimento
99538ffc9b
1 ficheiros alterados com 3 adições e 1 eliminações
  1. +3
    -1
      bubble-server/src/main/java/bubble/model/cloud/notify/NotificationType.java

+ 3
- 1
bubble-server/src/main/java/bubble/model/cloud/notify/NotificationType.java Ver ficheiro

@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;

import static bubble.ApiConstants.enumFromString;
import static org.cobbzilla.util.daemon.ZillaRuntime.die;
import static org.cobbzilla.util.daemon.ZillaRuntime.getSystemTimeOffset;
import static org.cobbzilla.util.json.JsonUtil.json;
import static org.cobbzilla.util.reflect.ReflectionUtil.forName;
import static org.cobbzilla.util.reflect.ReflectionUtil.instantiate;
@@ -135,6 +136,7 @@ public enum NotificationType {
// payment validation requests are never cached, because the response depends on data outside the message
// specifically, if the user does not have any validated email address, an error is returned
// but an identical notification can later return a different response, after the email has been validated
return this != payment_driver_validate;
// also, do not cache if the system time has been altered
return this != payment_driver_validate && getSystemTimeOffset() == 0;
}
}

Carregando…
Cancelar
Guardar