Fix launcher input not triggering on startup

This commit is contained in:
crschnick 2024-05-26 20:32:58 +00:00
parent 8e8f10676a
commit 4d9e47b821
3 changed files with 15 additions and 0 deletions

View file

@ -3,6 +3,7 @@ package io.xpipe.app.exchange;
import io.xpipe.app.core.mode.OperationMode;
import io.xpipe.app.launcher.LauncherInput;
import io.xpipe.app.util.PlatformState;
import io.xpipe.app.util.ThreadHelper;
import io.xpipe.beacon.BeaconHandler;
import io.xpipe.beacon.ServerException;
import io.xpipe.beacon.exchange.OpenExchange;
@ -18,6 +19,11 @@ public class OpenExchangeImpl extends OpenExchange
}
}
// Wait for startup
while (OperationMode.get() == null) {
ThreadHelper.sleep(100);
}
LauncherInput.handle(msg.getArguments());
return Response.builder().build();
}

View file

@ -79,6 +79,7 @@ public abstract class LauncherInput {
try {
a = found.get().getLauncherCallSite().createAction(uri);
} catch (Exception e) {
ErrorEvent.fromThrowable(e).omit().expected().handle();
return List.of();
}
return a != null ? List.of(a) : List.of();

View file

@ -3,6 +3,7 @@ package io.xpipe.ext.base.action;
import io.xpipe.app.comp.store.StoreCreationComp;
import io.xpipe.app.comp.store.StoreViewState;
import io.xpipe.app.ext.ActionProvider;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.storage.DataStorage;
import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.core.store.DataStore;
@ -56,6 +57,13 @@ public class XPipeUrlAction implements ActionProvider {
var entry = DataStorage.get()
.getStoreEntryIfPresent(UUID.fromString(args.get(2)))
.orElseThrow();
TrackEvent.withDebug("Parsed action")
.tag("id", id)
.tag("provider", provider.getId())
.tag("entry", entry.getUuid())
.handle();
if (!entry.getValidity().isUsable()) {
return null;
}