Skip to content

Commit b081b39

Browse files
authored
Release v1.54.0 (#1239)
feat(tiles): revoke shareable link feat(tiles): allow users to toggle between editing and viewing feat: duplicate and reorder step fix: trim long sender names for postman email fix: blacklisted emails and invalid attachments getting escaped fix: temporarily disable dd test visibility
2 parents 8296716 + d61e6c4 commit b081b39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2028
-313
lines changed

.github/workflows/test-and-build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ jobs:
1919
- run: npm ci
2020
env:
2121
NPM_TASKFORCESH_TOKEN: ${{ secrets.NPM_TASKFORCESH_TOKEN }}
22-
- name: Configure Datadog Test Visibility
23-
env:
24-
DD_SERVICE_NAME: ${{ secrets.DD_SERVICE_NAME }}
25-
DD_API_KEY: ${{ secrets.DD_API_KEY }}
26-
uses: datadog/test-visibility-github-action@v1
27-
with:
28-
languages: js
29-
service: ${{ secrets.DD_SERVICE_NAME }}
30-
api_key: ${{ secrets.DD_API_KEY }}
22+
# - name: Configure Datadog Test Visibility
23+
# env:
24+
# DD_SERVICE_NAME: ${{ secrets.DD_SERVICE_NAME }}
25+
# DD_API_KEY: ${{ secrets.DD_API_KEY }}
26+
# uses: datadog/test-visibility-github-action@v1
27+
# with:
28+
# languages: js
29+
# service: ${{ secrets.DD_SERVICE_NAME }}
30+
# api_key: ${{ secrets.DD_API_KEY }}
3131
- run: npm run lint
3232
- run: echo "✅ Your code has been linted."
3333
- run: npm run test
34-
env:
35-
# Required to allow Datadog to trace Vitest tests
36-
NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }}
34+
# env:
35+
# # Required to allow Datadog to trace Vitest tests
36+
# NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }}
3737
- run: echo "✅ All tests passed."
3838
- run: VITE_MODE=test npm run build
3939
- run: echo "✅ Your code has been built."

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.53.3"
114+
"version": "1.54.0"
115115
}

packages/backend/src/apps/postman/__tests__/common/parameters.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,12 @@ describe('postman transactional email schema zod validation', () => {
188188
)
189189
},
190190
)
191+
192+
it('should trim long reply to email', () => {
193+
validPayload.senderName = 'a'.repeat(256)
194+
const validLength = 255 - ' <[email protected]>'.length
195+
const result = transactionalEmailSchema.safeParse(validPayload)
196+
assert(result.success === true)
197+
expect(result.data.senderName).toEqual('a'.repeat(validLength))
198+
})
191199
})

packages/backend/src/apps/postman/common/parameters.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import validator from 'email-validator'
44
import { uniq } from 'lodash'
55
import { z } from 'zod'
66

7+
import appConfig from '@/config/app'
78
import { parseS3Id } from '@/helpers/s3'
89

910
import { POSTMAN_SUPPORTED_ATTACHMENTS_GUIDE_URL } from './constants'
@@ -121,7 +122,16 @@ export const transactionalEmailSchema = z.object({
121122
}
122123
return value.trim() === '' ? undefined : value.trim()
123124
}, z.string().email({ message: 'Invalid reply to email' }).optional()),
124-
senderName: z.string().min(1, { message: 'Empty sender name' }).trim(),
125+
senderName: z
126+
.string()
127+
.min(1, { message: 'Empty sender name' })
128+
.trim()
129+
// NOTE: we trim the sender name so that long sender names do not cause the email to fail.
130+
// Postman limits the sender name to 255 characters.
131+
// the API sends "{senderName} <[email protected]>" so it needs to be included in the calculation.
132+
.transform((value) =>
133+
value.substring(0, 255 - ` <${appConfig.postman.fromAddress}>`.length),
134+
),
125135
attachments: z.array(z.string()).transform((array, context) => {
126136
const result: string[] = []
127137
for (const value of array) {

packages/backend/src/apps/postman/common/send-blacklist-email.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DateTime } from 'luxon'
22

33
import { redisClient as pipeErrorRedisClient } from '@/helpers/generate-error-email'
4-
import { safeHtml } from '@/helpers/html-utils'
4+
import { escapeHtml, safeHtml, trustedHtml } from '@/helpers/html-utils'
55
import { sendEmail } from '@/helpers/send-email'
66

77
const MAX_LENGTH = 80
@@ -58,7 +58,11 @@ function createBodyErrorMessage(props: BlacklistEmailProps): string {
5858
<br>
5959
We have detected that your pipe <strong>${flowName}</strong> has attempted to send an email to one or more blacklisted email addresses:
6060
<ul>
61-
${blacklistedRecipients.map((email) => `<li>${email}</li>`).join('\n')}
61+
${trustedHtml(
62+
blacklistedRecipients
63+
.map((email) => `<li>${escapeHtml(email)}</li>`)
64+
.join('\n'),
65+
)}
6266
</ul>
6367
Emails could be blacklisted for one of the following reasons:
6468
<ul>

packages/backend/src/apps/postman/common/send-invalid-attachments-email.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { truncateFlowName } from '@/helpers/generate-error-email'
2-
import { safeHtml } from '@/helpers/html-utils'
2+
import { escapeHtml, safeHtml, trustedHtml } from '@/helpers/html-utils'
33
import { sendEmail } from '@/helpers/send-email'
44

55
interface SendInvalidAttachmentsEmailProps {
@@ -23,7 +23,9 @@ export function createInvalidAttachmentsMessage(props: CreateMessageProps) {
2323
const bodyMessage = safeHtml`
2424
We have detected that your pipe <strong>${flowName}</strong> has attempted to send an email with one or more attachments that are not supported:
2525
<ul>
26-
${invalidAttachments.map((a) => `<li>${a}</li>`).join('\n')}
26+
${trustedHtml(
27+
invalidAttachments.map((a) => `<li>${escapeHtml(a)}</li>`).join('\n'),
28+
)}
2729
</ul>
2830
The details of the affected execution are as follows:
2931
<ul>

0 commit comments

Comments
 (0)