chore(backend): rename lastSyncTimestamp to since across Ping sync API for consistency

- Updated parameter name in `PingController`, `PingApi`, and related tests to align with SyncManager conventions.
This commit is contained in:
2026-02-01 17:56:05 +01:00
parent cf7179ed64
commit 05e85ff98e
3 changed files with 7 additions and 4 deletions
@@ -80,9 +80,10 @@ class PingController(
@GetMapping("/ping/sync") @GetMapping("/ping/sync")
override suspend fun syncPings( override suspend fun syncPings(
@RequestParam(required = false, defaultValue = "0") lastSyncTimestamp: Long // Changed the parameter name to 'since' to match SyncManager convention
@RequestParam(required = false, defaultValue = "0") since: Long
): List<PingEvent> { ): List<PingEvent> {
return pingUseCase.getPingsSince(lastSyncTimestamp).map { return pingUseCase.getPingsSince(since).map {
PingEvent( PingEvent(
id = it.id.toString(), id = it.id.toString(),
message = it.message, message = it.message,
@@ -153,7 +153,8 @@ class PingControllerTest {
) )
// When & Then // When & Then
val mvcResult: MvcResult = mockMvc.perform(get("/ping/sync").param("lastSyncTimestamp", timestamp.toString())) // Changed parameter name to 'since' to match the controller update
val mvcResult: MvcResult = mockMvc.perform(get("/ping/sync").param("since", timestamp.toString()))
.andExpect(request().asyncStarted()) .andExpect(request().asyncStarted())
.andReturn() .andReturn()
@@ -10,5 +10,6 @@ interface PingApi {
suspend fun securePing(): PingResponse suspend fun securePing(): PingResponse
// Phase 3: Delta-Sync // Phase 3: Delta-Sync
suspend fun syncPings(lastSyncTimestamp: Long): List<PingEvent> // Changed parameter name to 'since' to match SyncManager convention and backend controller
suspend fun syncPings(since: Long): List<PingEvent>
} }