Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 72201637 authored by Fahim M. Choudhury's avatar Fahim M. Choudhury
Browse files

refactor(updates): remove unused createdAtMillis from snapshot

parent ee74223e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -24,17 +24,14 @@ data class ManualUpdateChainSnapshot(
    val chainId: String,
    val packages: List<Application>,
    val cursor: Int = 0,
    val createdAtMillis: Long,
)

fun buildManualUpdateChainSnapshot(
    chainId: String,
    applications: List<Application>,
    createdAtMillis: Long,
): ManualUpdateChainSnapshot {
    return ManualUpdateChainSnapshot(
        chainId = chainId,
        packages = applications,
        createdAtMillis = createdAtMillis,
    )
}
+0 −1
Original line number Diff line number Diff line
@@ -392,7 +392,6 @@ class UpdatesFragment : TimeoutFragment(R.layout.fragment_updates), ApplicationI
                    buildManualUpdateChainSnapshot(
                        chainId = chainId,
                        applications = orderedUpdates,
                        createdAtMillis = System.currentTimeMillis(),
                    )
                )
                UpdatesWorkManager.startUpdateAllWork(requireContext(), chainId)
+0 −2
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ class ManualUpdateChainStoreTest {

        val storedSnapshot = store.readSnapshot(CHAIN_ID)
        assertNotNull(storedSnapshot)
        assertEquals(snapshot.createdAtMillis, storedSnapshot?.createdAtMillis)
        assertApplicationFields(snapshot.packages[0], storedSnapshot!!.packages[0])
        assertApplicationFields(snapshot.packages[1], storedSnapshot.packages[1])
        assertApplicationFields(snapshot.packages[2], storedSnapshot.packages[2])
@@ -96,7 +95,6 @@ class ManualUpdateChainStoreTest {
        return ManualUpdateChainSnapshot(
            chainId = chainId,
            cursor = cursor,
            createdAtMillis = 1234L,
            packages = listOf(
                createApplication("one"),
                createApplication("two"),
+0 −5
Original line number Diff line number Diff line
@@ -1010,7 +1010,6 @@ class UpdatesWorkerTest {
            buildManualUpdateChainSnapshot(
                chainId = MANUAL_CHAIN_ID,
                applications = snapshotApplications,
                createdAtMillis = 1234L,
            )
        )
        whenever(playStoreAuthManager.getValidatedAuthData()).thenReturn(ResultSupreme.Error("no auth"))
@@ -1085,7 +1084,6 @@ class UpdatesWorkerTest {
            buildManualUpdateChainSnapshot(
                chainId = MANUAL_CHAIN_ID,
                applications = snapshotApplications,
                createdAtMillis = 1234L,
            )
        )
        whenever(playStoreAuthManager.getValidatedAuthData()).thenReturn(ResultSupreme.Error("no auth"))
@@ -1153,7 +1151,6 @@ class UpdatesWorkerTest {
            buildManualUpdateChainSnapshot(
                chainId = MANUAL_CHAIN_ID,
                applications = snapshotApplications,
                createdAtMillis = 1234L,
            )
        )
        whenever(playStoreAuthManager.getValidatedAuthData()).thenReturn(ResultSupreme.Error("no auth"))
@@ -1220,7 +1217,6 @@ class UpdatesWorkerTest {
            buildManualUpdateChainSnapshot(
                chainId = MANUAL_CHAIN_ID,
                applications = snapshotApplications,
                createdAtMillis = 1234L,
            ).copy(cursor = 15)
        )
        whenever(playStoreAuthManager.getValidatedAuthData()).thenReturn(ResultSupreme.Error("no auth"))
@@ -1274,7 +1270,6 @@ class UpdatesWorkerTest {
            buildManualUpdateChainSnapshot(
                chainId = MANUAL_CHAIN_ID,
                applications = snapshotApplications,
                createdAtMillis = 1234L,
            )
        )
        whenever(playStoreAuthManager.getValidatedAuthData()).thenReturn(ResultSupreme.Error("no auth"))