Never decrement the lastUsage of a session duration limitation

This commit is contained in:
Jonas Lochmann 2021-12-20 01:00:00 +01:00
parent bc80ccc731
commit 9f2ea6e741
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36

View file

@ -199,7 +199,9 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
oldItem.roundedLastUpdate = roundedTimestampForSessionDuration oldItem.roundedLastUpdate = roundedTimestampForSessionDuration
if (hasTrustedTimestamp) { if (hasTrustedTimestamp) {
oldItem.lastUsage = action.trustedTimestamp.toString(10) if (parseInt(oldItem.lastUsage, 10) < action.trustedTimestamp) {
oldItem.lastUsage = action.trustedTimestamp.toString(10)
}
} }
await oldItem.save({ transaction: cache.transaction }) await oldItem.save({ transaction: cache.transaction })