Skip to content

Commit b173fa6

Browse files
authored
Release v1.42.0 (#1008)
## Changes 1. Use RDS Proxy 2. Read postman queue rate limit from env var 3. Hide empty row ID tooltip in update row action ## To check Env vars are set: - [x] plumber-prod-rds-proxy-host - [x] plumber-prod-postman-rate-limit
2 parents 9803795 + bfd6625 commit b173fa6

File tree

14 files changed

+43
-36
lines changed

14 files changed

+43
-36
lines changed

ecs/env.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
{
4444
"name": "ENABLE_BULLMQ_DASHBOARD",
4545
"value": "true"
46-
},
47-
{
48-
"name": "POSTMAN_SMS_QPS_LIMIT_PER_CAMPAIGN",
49-
"value": "5"
5046
}
5147
],
5248
"secrets": [
@@ -217,6 +213,14 @@
217213
{
218214
"name": "ONBOARDING_EMAIL_WEBHOOK_URL",
219215
"valueFrom": "plumber-onboarding-email-webhook-url"
216+
},
217+
{
218+
"name": "POSTMAN_SMS_QPS_LIMIT_PER_CAMPAIGN",
219+
"valueFrom": "plumber-<ENVIRONMENT>-postman-sms-qps"
220+
},
221+
{
222+
"name": "RDS_PROXY_HOST",
223+
"valueFrom": "plumber-<ENVIRONMENT>-rds-proxy-host"
220224
}
221225
]
222226
}

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
@@ -106,5 +106,5 @@
106106
"tsconfig-paths": "^4.2.0",
107107
"type-fest": "4.10.3"
108108
},
109-
"version": "1.41.0"
109+
"version": "1.42.0"
110110
}

packages/backend/src/apps/postman/__tests__/actions/send-transactional-email.test.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
66
import HttpError from '@/errors/http'
77
import PartialStepError from '@/errors/partial-error'
88
import RetriableError from '@/errors/retriable-error'
9-
import StepError from '@/errors/step'
109

1110
import sendTransactionalEmail from '../../actions/send-transactional-email'
1211

@@ -140,15 +139,6 @@ describe('send transactional email', () => {
140139
errorStatusText: 'Bad Request',
141140
stepErrorName: 'Unsupported attachment file type',
142141
},
143-
{
144-
postmanResponseData: {
145-
code: 'rate_limit',
146-
message: 'Too many requests. Please try again later.',
147-
},
148-
errorStatusCode: 429,
149-
errorStatusText: 'Bad Request',
150-
stepErrorName: 'Too many requests',
151-
},
152142
])(
153143
'should throw step error for different postman errors',
154144
async ({
@@ -337,7 +327,9 @@ describe('send transactional email', () => {
337327
} as AxiosError),
338328
)
339329

340-
await expect(sendTransactionalEmail.run($)).rejects.toThrowError(StepError)
330+
await expect(sendTransactionalEmail.run($)).rejects.toThrowError(
331+
RetriableError,
332+
)
341333
expect($.setActionItem).toHaveBeenCalledWith({
342334
raw: {
343335
status: ['ACCEPTED', 'BLACKLISTED', 'RATE-LIMITED'],

packages/backend/src/apps/postman/common/throw-errors.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,11 @@ export function throwPostmanStepError({
9292
}
9393
case 'RATE-LIMITED':
9494
// this will be auto-retried later on
95-
throw new StepError(
96-
'Rate limit exceeded',
97-
'Too many emails are being sent. Please wait for a while before retrying.',
98-
position,
99-
appName,
100-
error,
101-
)
95+
throw new RetriableError({
96+
error: error.details,
97+
delayInMs: 'default',
98+
delayType: 'queue',
99+
})
102100
case 'INVALID-ATTACHMENT':
103101
throw new StepError(
104102
'Unsupported attachment file type',

packages/backend/src/apps/postman/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { IApp } from '@plumber/types'
22

3-
import { getGenericAppQueue } from '@/queues/helpers/get-generic-app-queue'
4-
53
import actions from './actions'
4+
import queue from './queue'
65

76
const app: IApp = {
87
name: 'Email by Postman',
@@ -21,7 +20,7 @@ const app: IApp = {
2120
url: 'https://demo.arcade.software/VppMAbGKfFXFEsKxnKiw?embed&show_copy_link=true',
2221
title: 'Setting up Email by Postman',
2322
},
24-
queue: getGenericAppQueue('POSTMAN_EMAIL'),
23+
queue,
2524
category: 'communication',
2625
}
2726

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { IAppQueue } from '@plumber/types'
2+
3+
import appConfig from '@/config/app'
4+
5+
const queueSettings = {
6+
queueRateLimit: {
7+
duration: 1000,
8+
max: appConfig.postman.rateLimit,
9+
},
10+
isQueueDelayable: true,
11+
} satisfies IAppQueue
12+
13+
export default queueSettings

packages/backend/src/apps/tiles/__tests__/actions/find-single-row.itest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('tiles create row action', () => {
171171
expect($.setActionItem).toBeCalledWith({
172172
raw: {
173173
rowsFound: 0,
174-
rowId: '',
174+
rowId: ' ',
175175
row: emptyRow,
176176
},
177177
})

packages/backend/src/apps/tiles/actions/find-single-row/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ const action: IRawAction = {
198198
$.setActionItem({
199199
raw: {
200200
rowsFound: 0,
201-
rowId: '',
201+
// NOTE: intentionally return whitespace so that a solid pill is shown
202+
rowId: ' ',
202203
row: emptyRow,
203204
} satisfies FindSingleRowOutput,
204205
})

packages/backend/src/config/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ const appConfig: AppConfig = {
6969
version: process.env.npm_package_version,
7070
postgresDatabase: process.env.POSTGRES_DATABASE || 'plumber_dev',
7171
postgresPort: parseInt(process.env.POSTGRES_PORT || '5432'),
72-
postgresHost: process.env.POSTGRES_HOST || 'localhost',
72+
postgresHost:
73+
process.env.RDS_PROXY_HOST || process.env.POSTGRES_HOST || 'localhost',
7374
postgresUsername: process.env.POSTGRES_USERNAME,
7475
postgresPassword: process.env.POSTGRES_PASSWORD,
7576
postgresEnableSsl: process.env.POSTGRES_ENABLE_SSL === 'true',

0 commit comments

Comments
 (0)