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:
Stefan Mogeritsch 2026-02-01 17:56:05 +01:00
parent cf7179ed64
commit 05e85ff98e
3 changed files with 7 additions and 4 deletions

View File

@ -80,9 +80,10 @@ class PingController(
@GetMapping("/ping/sync")
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> {
return pingUseCase.getPingsSince(lastSyncTimestamp).map {
return pingUseCase.getPingsSince(since).map {
PingEvent(
id = it.id.toString(),
message = it.message,

View File

@ -153,7 +153,8 @@ class PingControllerTest {
)
// 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())
.andReturn()

View File

@ -10,5 +10,6 @@ interface PingApi {
suspend fun securePing(): PingResponse
// 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>
}