Wait for messages in waitForNewLinkedDevice

This commit is contained in:
Ravi Khadiwala
2024-11-07 15:47:21 -06:00
committed by ravi-signal
parent 3288d3d538
commit 81f3ba17c7
16 changed files with 374 additions and 60 deletions

View File

@@ -362,9 +362,9 @@ public class DeviceController {
linkedDeviceListenerCounter.incrementAndGet();
final Timer.Sample sample = Timer.start();
try {
return accounts.waitForNewLinkedDevice(tokenIdentifier, Duration.ofSeconds(timeoutSeconds))
return accounts.waitForNewLinkedDevice(authenticatedDevice.getAccount().getUuid(),
authenticatedDevice.getAuthenticatedDevice(), tokenIdentifier, Duration.ofSeconds(timeoutSeconds))
.thenApply(maybeDeviceInfo -> maybeDeviceInfo
.map(deviceInfo -> Response.status(Response.Status.OK).entity(deviceInfo).build())
.orElseGet(() -> Response.status(Response.Status.NO_CONTENT).build()))