Skip to content

Commit 3050098

Browse files
fix(mobile): saving keeps the current webhook signature and copies a full URL
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent b2a1824 commit 3050098

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { ScreenScrollView as ScrollView } from "../../components/ScreenScrollVie
3939
import { SegmentedControl } from "../../components/SegmentedControl";
4040
import { ThemedSwitch } from "../../components/ThemedSwitch";
4141
import { tryCopyTextWithHaptic } from "../../lib/copyTextWithHaptic";
42+
import { usePreparedConnection } from "../../state/session";
4243
import { buildModelOptions } from "../../lib/modelOptions";
4344
import { NativeStackScreenOptions } from "../../native/StackHeader";
4445
import { useProjects, useEnvironmentServerConfig } from "../../state/entities";
@@ -585,7 +586,14 @@ function TaskForm({
585586
environmentUnavailable
586587
)
587588
return;
588-
const schedule = scheduleFromDraft(draft.schedule);
589+
// Signatures are edited on desktop and web; send the task's current one,
590+
// not the copy taken when this form opened, so a newer edit survives.
591+
const liveTask = tasks.data?.tasks.find((task) => task.id === draft.task?.id);
592+
const schedule = scheduleFromDraft(
593+
draft.schedule.mode === "webhook" && liveTask?.schedule.type === "webhook"
594+
? { ...draft.schedule, signature: liveTask.schedule.signature }
595+
: draft.schedule,
596+
);
589597
if (
590598
!draft.title.trim() ||
591599
!draft.prompt.trim() ||
@@ -960,8 +968,14 @@ function WebhookScheduleDetails({
960968
label: "scheduled task rotate webhook token",
961969
reportFailure: false,
962970
});
971+
const preparedConnection = usePreparedConnection(environmentId);
972+
const httpBaseUrl =
973+
preparedConnection._tag === "Some" ? preparedConnection.value.httpBaseUrl : null;
963974
const webhook = task?.schedule.type === "webhook" ? task.webhook : undefined;
964-
const address = webhook ? (webhook.url ?? webhook.path) : null;
975+
// Without T3 Connect, the path is resolved on the address this phone uses.
976+
const address = webhook
977+
? (webhook.url ?? (httpBaseUrl ? new URL(webhook.path, httpBaseUrl).href : webhook.path))
978+
: null;
965979
return (
966980
<View className="gap-2 border-t border-border-subtle px-4 py-3">
967981
<Text className="text-sm text-foreground-muted">

0 commit comments

Comments
 (0)