Преглед на файлове

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

tags/v0.1.8
Jonathan Cobb преди 5 години
родител
ревизия
99538ffc9b
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  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 Целия файл

@@ -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;
}
}

Зареждане…
Отказ
Запис