patchrelay 0.20.3 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +3 -3
- package/dist/cli/watch/App.js +18 -8
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/cli/watch/App.js
CHANGED
|
@@ -29,11 +29,17 @@ async function postRetry(baseUrl, issueKey, bearerToken) {
|
|
|
29
29
|
const headers = { "content-type": "application/json" };
|
|
30
30
|
if (bearerToken)
|
|
31
31
|
headers.authorization = `Bearer ${bearerToken}`;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(new URL(`/api/issues/${encodeURIComponent(issueKey)}/retry`, baseUrl), {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers,
|
|
36
|
+
signal: AbortSignal.timeout(5000),
|
|
37
|
+
});
|
|
38
|
+
return await response.json();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return { reason: "request failed" };
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
export function App({ baseUrl, bearerToken, initialIssueKey }) {
|
|
39
45
|
const { exit } = useApp();
|
|
@@ -48,9 +54,13 @@ export function App({ baseUrl, bearerToken, initialIssueKey }) {
|
|
|
48
54
|
const [promptMode, setPromptMode] = useState(false);
|
|
49
55
|
const [promptBuffer, setPromptBuffer] = useState("");
|
|
50
56
|
const handleRetry = useCallback(() => {
|
|
51
|
-
if (state.activeDetailKey)
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
if (!state.activeDetailKey)
|
|
58
|
+
return;
|
|
59
|
+
setPromptStatus("retrying...");
|
|
60
|
+
void postRetry(baseUrl, state.activeDetailKey, bearerToken).then((result) => {
|
|
61
|
+
setPromptStatus(result.ok ? "retry queued" : `retry failed: ${result.reason ?? "unknown"}`);
|
|
62
|
+
setTimeout(() => setPromptStatus(null), 3000);
|
|
63
|
+
});
|
|
54
64
|
}, [baseUrl, bearerToken, state.activeDetailKey]);
|
|
55
65
|
const [promptStatus, setPromptStatus] = useState(null);
|
|
56
66
|
const handlePromptSubmit = useCallback(() => {
|