Skip to content

Commit b9f1805

Browse files
authored
Release v1.56.2 (#1342)
- fix(telegram-bot): enable retries for socket hang up as stop gap - fix(frontend):remove manual cache manipulation - chore(frontend): collab what's new and shift buttons - chore(frontend): hide whats new based on ld flag - chore(backend): cascade flow_connections - chore(admin): export EditorSettingsFlowCollaborators
2 parents 0a2e51e + 8030d34 commit b9f1805

File tree

16 files changed

+99
-112
lines changed

16 files changed

+99
-112
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.56.1"
114+
"version": "1.56.2"
115115
}

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,23 @@ export async function throwSendMessageError(
1515
testRun: boolean,
1616
): Promise<never> {
1717
const position = step.position
18-
logger.error('Telegram bot error', {
19-
error: err,
20-
})
18+
2119
// catch telegram errors with different error format for ETIMEDOUT and ECONNRESET: e.g. details: { error: 'connect ECONNREFUSED 127.0.0.1:3002' }
20+
const errorDetails = JSON.stringify(get(err, 'details', {}))
2221
const errorString = JSON.stringify(get(err, 'details.error', ''))
22+
logger.error({
23+
event: 'telegram-bot-error',
24+
error: errorDetails,
25+
stepId: step.id,
26+
testRun,
27+
})
28+
2329
if (
2430
errorString.includes('ECONNRESET') ||
2531
errorString.includes('ETIMEDOUT') ||
2632
err.message.includes('ETIMEDOUT') ||
27-
err.code === 'ETIMEDOUT'
33+
err.code === 'ETIMEDOUT' ||
34+
errorString.includes('socket hang up')
2835
) {
2936
logger.error(`Telegram ip error: ${err.resolvedIp}`)
3037
throw new RetriableError({
@@ -37,7 +44,6 @@ export async function throwSendMessageError(
3744
/**
3845
* TODO: Temporary error handling since I cant find a way to catch the ETIMEDOUT error
3946
*/
40-
const errorDetails = JSON.stringify(get(err, 'details', {}))
4147
if (errorDetails === '{"error": "Error"}') {
4248
throw new RetriableError({
4349
error: 'Timeout error. Telegram may be experiencing issues.',
@@ -132,6 +138,12 @@ export async function throwSendMessageError(
132138
appName,
133139
err,
134140
)
141+
case 504:
142+
throw new RetriableError({
143+
error: 'Timeout error. Telegram may be experiencing issues.',
144+
delayInMs: 'default',
145+
delayType: 'step',
146+
})
135147
default:
136148
// return original error since uncaught
137149
throw err
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Knex } from 'knex'
2+
3+
export async function up(knex: Knex): Promise<void> {
4+
await knex.schema.table('flow_connections', (table) => {
5+
table.index(['connection_id'])
6+
})
7+
}
8+
9+
export async function down(knex: Knex): Promise<void> {
10+
await knex.schema.table('flow_connections', (table) => {
11+
table.dropIndex(['connection_id'])
12+
})
13+
}
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1+
import FlowConnections from '@/models/flow-connections'
2+
13
import type { MutationResolvers } from '../__generated__/types.generated'
24

35
const deleteConnection: MutationResolvers['deleteConnection'] = async (
46
_parent,
57
params,
68
context,
79
) => {
8-
await context.currentUser
9-
.$relatedQuery('connections')
10-
.delete()
11-
.findOne({
12-
id: params.input.id,
13-
})
14-
.throwIfNotFound()
10+
return await FlowConnections.transaction(async (trx) => {
11+
await context.currentUser
12+
.$relatedQuery('connections', trx)
13+
.delete()
14+
.findOne({
15+
id: params.input.id,
16+
})
17+
.throwIfNotFound()
18+
19+
// also delete the connection from the flow_connections table for flows with collaborators
20+
await FlowConnections.query(trx)
21+
.delete()
22+
.where({ connection_id: params.input.id })
1523

16-
return true
24+
return true
25+
})
1726
}
1827

1928
export default deleteConnection

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.56.1",
3+
"version": "1.56.2",
44
"type": "module",
55
"scripts": {
66
"dev": "wait-on tcp:3000 && vite --host --force",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function ChooseConnectionSubstep(
7171
flowId: step.flowId,
7272
supportsConnectionRegistration,
7373
},
74+
fetchPolicy: 'cache-first',
7475
skip: !connection?.id,
7576
})
7677

packages/frontend/src/components/EditorSettings/FlowShare/AddNewCollaborator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const AddNewCollaborator = ({
119119
type="submit"
120120
isLoading={isAdding}
121121
isDisabled={!isValid}
122-
alignSelf="flex-end"
122+
alignSelf="flex-start"
123123
>
124124
Add collaborator
125125
</Button>

packages/frontend/src/components/EditorSettings/FlowTransfer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default function FlowTransfer() {
105105
<Button
106106
type="submit"
107107
isDisabled={shouldDisableInput || !isValid}
108-
alignSelf="flex-end"
108+
alignSelf="flex-start"
109109
mt={8}
110110
>
111111
Transfer Pipe

packages/frontend/src/components/EditorSettings/Notifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function NotificationFormFields() {
100100
w="fit-content"
101101
type="submit"
102102
isDisabled={!isDirty || isReadOnly}
103-
alignSelf="flex-end"
103+
alignSelf="flex-start"
104104
>
105105
{isDirty ? 'Save' : 'Saved'}
106106
</Button>

0 commit comments

Comments
 (0)