Skip to content

Commit

Permalink
fix: don't update read progress data upon upgrade or restore
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Sep 10, 2021
1 parent b691f30 commit eb9d505
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -9,8 +9,6 @@ import org.jooq.Query
import org.jooq.impl.DSL
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional
import java.time.LocalDateTime
import java.time.ZoneId

@Component
class ReadProgressDao(
Expand Down Expand Up @@ -73,7 +71,7 @@ class ReadProgressDao(
.onDuplicateKeyUpdate()
.set(r.PAGE, readProgress.page)
.set(r.COMPLETED, readProgress.completed)
.set(r.LAST_MODIFIED_DATE, LocalDateTime.now(ZoneId.of("Z")))
.set(r.LAST_MODIFIED_DATE, readProgress.lastModifiedDate.toUTC())

@Transactional
override fun delete(bookId: String, userId: String) {
Expand Down
Expand Up @@ -105,7 +105,8 @@ class ReadProgressDaoTest(
book1.id,
user1.id,
10,
true
true,
lastModifiedDate = modificationDate,
)
)

Expand Down

0 comments on commit eb9d505

Please sign in to comment.