diff --git a/dpppt-backend-sdk/dpppt-backend-sdk-data/src/main/java/org/dpppt/backend/sdk/data/gaen/JDBCGAENDataServiceImpl.java b/dpppt-backend-sdk/dpppt-backend-sdk-data/src/main/java/org/dpppt/backend/sdk/data/gaen/JDBCGAENDataServiceImpl.java index 84223bbe..fb6b47cb 100644 --- a/dpppt-backend-sdk/dpppt-backend-sdk-data/src/main/java/org/dpppt/backend/sdk/data/gaen/JDBCGAENDataServiceImpl.java +++ b/dpppt-backend-sdk/dpppt-backend-sdk-data/src/main/java/org/dpppt/backend/sdk/data/gaen/JDBCGAENDataServiceImpl.java @@ -63,7 +63,12 @@ public void upsertExposeesDelayed(List gaenKeys, OffsetDateTime delayed } var parameterList = new ArrayList(); var nowMillis = System.currentTimeMillis(); - //if delayedReceivedAt is supplied use it + // if delayedReceivedAt is supplied use it + // else we calculate the last moment of the current bucket like this: + // currentBucketNumber = Floor(now/releaseBucketDuration) + // nextBucketNumber = currentBucketNumber + 1 + // nextBucket = nextBucketNumber * releaseBucketDuration + // Since we have millisecond precision => lastMomentOfCurrentBucket = nextBucket - 1 var receivedAt = delayedReceivedAt == null? (nowMillis/releaseBucketDuration.toMillis() + 1) * releaseBucketDuration.toMillis() - 1 : delayedReceivedAt.toInstant().toEpochMilli(); for (var gaenKey : gaenKeys) { MapSqlParameterSource params = new MapSqlParameterSource(); diff --git a/dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java b/dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java index 14889b8a..0e9bccdd 100644 --- a/dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java +++ b/dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java @@ -150,8 +150,9 @@ public GaenController(GAENDataService dataService, FakeKeyService fakeKeyService } if(delayTodaysKeys) { - // Additionally to delaying keys this feature also make sure rolling period is always set to 144 - // to make sure iOS 13.5.x does not ignore the TEK. + // Additionally to delaying keys this feature also makes sure rolling period is always set to 144 + // to make sure iOS 13.5.x does not ignore the TEK. The calculations of the RPIs should still be true, + // though more keys might be checked. key.setRollingPeriod(GaenKey.GaenKeyDefaultRollingPeriod); var rollingStartNumberDuration = Duration.of(key.getRollingStartNumber(), GaenUnit.TenMinutes).toMillis();