Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const { withSentryConfig } = require('@sentry/nextjs')
/** @type {import('next').NextConfig} */
const nextConfig = {
cacheMaxMemorySize: 0,
// Pure-ESM deps; transpile so next/jest can load them from CJS.
transpilePackages: ['p-retry', 'is-network-error'],
turbopack: {
rules: {
'*.svg': {
Expand All @@ -11,7 +13,7 @@ const nextConfig = {
},
},
},
allowedDevOrigins: ['*.ngrok-free.dev'],
allowedDevOrigins: ['*.ngrok-free.dev', '*.ngrok-free.app'],
async redirects() {
return [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "Tasks" ALTER COLUMN "label" SET DEFAULT '';
DROP TABLE "Labels";
12 changes: 0 additions & 12 deletions prisma/schema/label.prisma

This file was deleted.

2 changes: 1 addition & 1 deletion prisma/schema/task.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum Source {

model Task {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
label String
label String @default("")
workspaceId String @db.VarChar(32)
assigneeId String? @db.Uuid
internalUserId String? @db.Uuid
Expand Down
44 changes: 0 additions & 44 deletions src/app/api/label-mapping/label-mapping.service.test.ts

This file was deleted.

185 changes: 0 additions & 185 deletions src/app/api/label-mapping/label-mapping.service.ts

This file was deleted.

69 changes: 69 additions & 0 deletions src/app/api/tasks/public/public.serializer.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
jest.mock('@/utils/CopilotAPI', () => ({ CopilotAPI: class {} }))
jest.mock('@/lib/db', () => ({ __esModule: true, default: { getInstance: () => ({}) } }))
jest.mock('@/app/api/attachments/public/public.serializer', () => ({
PublicAttachmentSerializer: { serializeAttachments: jest.fn(async () => []) },
}))
jest.mock('@/utils/santizeContents', () => ({ sanitizeHtml: (value: string) => value }))
jest.mock('@/utils/signedUrlReplacer', () => ({
replaceMediaSources: jest.fn(async (value: string) => value),
replaceImageSrc: jest.fn(async (value: string) => value),
}))
jest.mock('@/utils/signUrl', () => ({ getSignedUrl: jest.fn(async (value: string) => value) }))
jest.mock('@/utils/signedTemplateUrlReplacer', () => ({
copyTemplateMediaToTask: jest.fn(async (_workspaceId: string, value: string) => value),
}))

import { PublicTaskSerializer, TaskWithWorkflowStateAndAttachments } from './public.serializer'

const IU_ID = '22222222-2222-2222-2222-222222222222'

const makeTask = (overrides: Partial<TaskWithWorkflowStateAndAttachments> = {}): TaskWithWorkflowStateAndAttachments =>
({
id: '11111111-1111-1111-1111-111111111111',
title: 'A task',
body: null,
parentId: null,
dueDate: null,
label: '',
templateId: null,
createdById: IU_ID,
completedAt: null,
createdAt: new Date('2026-01-01T00:00:00.000Z'),
isArchived: false,
lastArchivedDate: null,
archivedBy: null,
deletedAt: null,
source: 'api',
deletedBy: null,
completedBy: null,
completedByUserType: null,
internalUserId: IU_ID,
clientId: null,
companyId: null,
associations: [],
isShared: false,
workflowState: { type: 'started' },
attachments: [],
...overrides,
}) as unknown as TaskWithWorkflowStateAndAttachments

// OUT-4029: label generation was removed but the public API keeps the `label`
// field for backward compatibility — empty string for new tasks, the stored
// value for pre-existing ones. These lock that contract so a future change
// can't silently drop the field again.
describe('PublicTaskSerializer — label backward compatibility', () => {
it('returns an empty-string label for tasks created after label generation was removed', async () => {
const result = await PublicTaskSerializer.serializeUnsafe(makeTask({ label: '' }))
expect(result.label).toBe('')
})

it('preserves the pre-existing generated label for older tasks', async () => {
const result = await PublicTaskSerializer.serializeUnsafe(makeTask({ label: 'OUT-001' }))
expect(result.label).toBe('OUT-001')
})

it('keeps label in the schema-validated public DTO', async () => {
const result = await PublicTaskSerializer.serialize(makeTask({ label: 'OUT-001' }))
expect(result.label).toBe('OUT-001')
})
})
Loading
Loading