Skip to content

Commit 9570cbb

Browse files
authored
Release v1.54.3 (#1258)
## Release v1.54.3 - Track launchdarkly flag evaluations - Auto check formsg step - Show link to executions page from editor / remove announcement modal - Add a temporary catch for Telegram timeout error
2 parents 8f5c34e + d168c1f commit 9570cbb

File tree

28 files changed

+245
-124
lines changed

28 files changed

+245
-124
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@
111111
"tsconfig-paths": "^4.2.0",
112112
"type-fest": "4.10.3"
113113
},
114-
"version": "1.54.2"
114+
"version": "1.54.3"
115115
}

packages/backend/src/apps/formsg/auth/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import verifyCredentials from './verify-credentials'
1111

1212
const auth: IUserAddedConnectionAuth = {
1313
connectionType: 'user-added' as const,
14-
14+
autoCheckStep: true,
1515
fields: [
1616
{
1717
key: 'formId',

packages/backend/src/apps/telegram-bot/__tests__/actions/send-message.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe('send message', () => {
115115
mocks.httpPost.mockRejectedValueOnce(httpError)
116116
// throw partial step error message
117117
await expect(sendMessageAction.run($)).rejects.toThrowError(
118-
'Connection issues',
118+
RetriableError,
119119
)
120120
},
121121
)

packages/backend/src/apps/telegram-bot/common/throw-errors.ts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import get from 'lodash.get'
55
import HttpError from '@/errors/http'
66
import RetriableError from '@/errors/retriable-error'
77
import StepError from '@/errors/step'
8+
import logger from '@/helpers/logger'
89
import Step, { StepContext } from '@/models/step'
910

1011
export async function throwSendMessageError(
@@ -14,16 +15,34 @@ export async function throwSendMessageError(
1415
testRun: boolean,
1516
): Promise<never> {
1617
const position = step.position
18+
logger.error('Telegram bot error', {
19+
error: err,
20+
})
1721
// catch telegram errors with different error format for ETIMEDOUT and ECONNRESET: e.g. details: { error: 'connect ECONNREFUSED 127.0.0.1:3002' }
1822
const errorString = JSON.stringify(get(err, 'details.error', ''))
19-
if (errorString.includes('ECONNRESET') || errorString.includes('ETIMEDOUT')) {
20-
throw new StepError(
21-
'Connection issues',
22-
'Please retry in a few minutes because telegram is currently experiencing issues.',
23-
position,
24-
appName,
25-
err,
26-
)
23+
if (
24+
errorString.includes('ECONNRESET') ||
25+
errorString.includes('ETIMEDOUT') ||
26+
err.message.includes('ETIMEDOUT') ||
27+
err.code === 'ETIMEDOUT'
28+
) {
29+
throw new RetriableError({
30+
error: 'Timeout error. Telegram may be experiencing issues.',
31+
delayInMs: 'default',
32+
delayType: 'step',
33+
})
34+
}
35+
36+
/**
37+
* TODO: Temporary error handling since I cant find a way to catch the ETIMEDOUT error
38+
*/
39+
const errorDetails = JSON.stringify(get(err, 'details', {}))
40+
if (errorDetails === '{"error": "Error"}') {
41+
throw new RetriableError({
42+
error: 'Timeout error. Telegram may be experiencing issues.',
43+
delayInMs: 'default',
44+
delayType: 'step',
45+
})
2746
}
2847

2948
// catch telegram errors with proper http error format

packages/backend/src/errors/http.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import BaseError from './base'
66

77
export default class HttpError extends BaseError {
88
response: AxiosResponse
9+
code?: string
910

1011
constructor(error: AxiosError) {
1112
const computedError =
@@ -22,6 +23,9 @@ export default class HttpError extends BaseError {
2223
headers: {},
2324
}
2425

26+
// Pass code along
27+
this.code = error.code
28+
2529
//
2630
// Only preserve selected headers to avoid storing sensitive data.
2731
//

packages/backend/src/graphql/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ type ConnectionModalLabel {
278278
type AppAuth {
279279
connectionType: String!
280280
connectionRegistrationType: String
281-
282281
fields: [Field] # Only for user-added connections
283282
authenticationSteps: [AuthenticationStep]
284283
reconnectionSteps: [ReconnectionStep]
285284
connectionModalLabel: ConnectionModalLabel
285+
autoCheckStep: Boolean
286286
}
287287

288288
enum ArgumentEnumType {

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.54.2",
3+
"version": "1.54.3",
44
"type": "module",
55
"scripts": {
66
"dev": "wait-on tcp:3000 && vite --host --force",

packages/frontend/src/components/EditorLayout/EditorToolbar.tsx

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IFlow } from '@plumber/types'
22

3-
import { BiCog, BiInfoCircle } from 'react-icons/bi'
3+
import { BiCog, BiHistory, BiInfoCircle } from 'react-icons/bi'
44
import { HiOutlineDotsVertical } from 'react-icons/hi'
55
import { Link } from 'react-router-dom'
66
import { Hide, HStack, MenuButton, MenuList, Show } from '@chakra-ui/react'
@@ -101,6 +101,45 @@ const SettingsItem = ({
101101
)
102102
}
103103

104+
const ExecutionsItem = ({
105+
flowId,
106+
type,
107+
}: {
108+
flowId: string
109+
type: 'icon' | 'button'
110+
}) => {
111+
if (type === 'button') {
112+
return (
113+
<Button
114+
variant="clear"
115+
aria-label="executions"
116+
colorScheme="secondary"
117+
as={Link}
118+
to={URLS.EXECUTIONS_FOR_FLOW(flowId)}
119+
w="100%"
120+
>
121+
Executions
122+
</Button>
123+
)
124+
}
125+
return (
126+
<TouchableTooltip label="Executions" aria-label="executions-tooltip">
127+
<IconButton
128+
as={Link}
129+
to={URLS.EXECUTIONS_FOR_FLOW(flowId)}
130+
variant="clear"
131+
aria-label="executions"
132+
_hover={{
133+
color: 'primary.500',
134+
bg: 'interaction.muted.main.hover',
135+
}}
136+
icon={<BiHistory />}
137+
colorScheme="secondary"
138+
/>
139+
</TouchableTooltip>
140+
)
141+
}
142+
104143
interface EditorToolbarProps {
105144
flowId: string
106145
flow: IFlow
@@ -119,6 +158,7 @@ export default function EditorToolbar(props: EditorToolbarProps) {
119158
<>
120159
<Show above="md">
121160
<HStack>
161+
<ExecutionsItem {...props} type="icon" />
122162
<GuideItem type="icon" />
123163
<SettingsItem {...props} type="icon" />
124164
<PublishButton {...props} />
@@ -140,6 +180,7 @@ export default function EditorToolbar(props: EditorToolbarProps) {
140180
gap={2}
141181
px={2}
142182
>
183+
<ExecutionsItem {...props} type="button" />
143184
<GuideItem type="button" />
144185
<SettingsItem {...props} type="button" />
145186
<PublishButton {...props} />

packages/frontend/src/components/EditorLayout/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ export default function EditorLayout() {
279279
handleUnpublish={() => onFlowStatusUpdate(!flow.active)}
280280
/>
281281

282-
{shouldOpenAnnouncementModal && (
282+
{/* hardcoded to false to always hide announcement modal for now*/}
283+
{shouldOpenAnnouncementModal && false && (
283284
<AnnouncementModal
284285
isOpen={shouldOpenAnnouncementModal}
285286
onClose={handleCloseAnnouncementModal}

0 commit comments

Comments
 (0)