feat: clean old sessions (#219)

Co-authored-by: Florent Champigny <florent@bere.al>
This commit is contained in:
Florent CHAMPIGNY 2025-09-11 15:19:25 +02:00 committed by GitHub
parent 222b901833
commit c954ef289e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 83 additions and 26 deletions

View file

@ -96,6 +96,20 @@ interface FloconNetworkDao {
callId: String,
)
@Query(
"""
DELETE FROM FloconNetworkCallEntity
WHERE deviceId = :deviceId
AND packageName = :packageName
AND appInstance != :appInstance
""",
)
suspend fun deleteRequestOnDifferentSession(
deviceId: String,
packageName: String,
appInstance: Long,
)
@Query(
"""
DELETE FROM FloconNetworkCallEntity

View file

@ -90,6 +90,16 @@ class NetworkLocalDataSourceRoom(
)
}
override suspend fun deleteRequestOnDifferentSession(
deviceIdAndPackageName: DeviceIdAndPackageNameDomainModel,
) {
floconNetworkDao.deleteRequestOnDifferentSession(
deviceId = deviceIdAndPackageName.deviceId,
packageName = deviceIdAndPackageName.packageName,
appInstance = deviceIdAndPackageName.appInstance
)
}
override suspend fun deleteRequestsBefore(
deviceIdAndPackageName: DeviceIdAndPackageNameDomainModel,
callId: String