Skip to content

Commit 8243694

Browse files
committed
temp disable deduping
1 parent 848dee5 commit 8243694

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

football/src/main/scala/com/gu/mobile/notifications/football/lib/EventFilter.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class EventFilter[A <: Payload, D](distinctCheck: DynamoDistinctCheck[A, D]) ext
3737
}
3838

3939
def filterDynamoEvents(dynamoEvents: List[A])(implicit ec: ExecutionContext): Future[List[A]] = {
40-
Future.traverse(dynamoEvents)(filterDynamoEvent).map(_.flatten)
40+
// TODO: re-enable dedup
41+
Future.successful(dynamoEvents)
42+
// Future.traverse(dynamoEvents)(filterDynamoEvent).map(_.flatten)
4143
}
4244
}

notification/app/notification/controllers/Main.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,8 @@ final class Main(
109109
}
110110

111111
private def pushWithDuplicateProtection(notification: Notification, notificationReceivedTime: Instant): Future[Result] = {
112-
val isDuplicate = notificationReportRepository.getByUuid(notification.id).map(_.isRight)
113-
114-
isDuplicate.flatMap {
115-
case true => Future.successful(BadRequest(s"${notification.id} has been sent before - refusing to resend"))
116-
case false => pushGeneric(notification, notificationReceivedTime)
117-
}
112+
// TODO: re-enable duplicate protection
113+
pushGeneric(notification, notificationReceivedTime)
118114
}
119115

120116
private def pushGeneric(notification: Notification, notificationReceivedTime: Instant) = {

notification/test/notification/controllers/MainSpec.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ class MainSpec(implicit ec: ExecutionEnv) extends PlaySpecification with Mockito
3838

3939
status(response) must equalTo(UNAUTHORIZED)
4040
}
41-
"refuse a notification that is sent twice" in new MainScope {
42-
val request = requestWithValidTopics
43-
val firstResponse = main.pushTopics()(request)
44-
status(firstResponse) must equalTo(CREATED)
45-
val secondResponse = main.pushTopics()(request)
46-
status(secondResponse) must equalTo(BAD_REQUEST)
47-
}
41+
// "refuse a notification that is sent twice" in new MainScope {
42+
// val request = requestWithValidTopics
43+
// val firstResponse = main.pushTopics()(request)
44+
// status(firstResponse) must equalTo(CREATED)
45+
// val secondResponse = main.pushTopics()(request)
46+
// status(secondResponse) must equalTo(BAD_REQUEST)
47+
// }
4848
"refuse a notification without a topic" in new MainScope {
4949
val request = authenticatedRequest.withBody(breakingNewsNotification(List()))
5050
status(main.pushTopics()(request)) must equalTo(BAD_REQUEST)

0 commit comments

Comments
 (0)