Skip to content
Merged
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
3 changes: 3 additions & 0 deletions backend/src/entities/table/table.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import {
IImportCSVFinTable,
IUpdateRowInTable,
} from './use-cases/table-use-cases.interface.js';
import { Throttle } from '@nestjs/throttler';

Comment on lines 63 to 67

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throttle import is out of the usual import grouping/order (external @nestjs/* imports are grouped at the top in other controllers). Consider moving import { Throttle } from '@nestjs/throttler'; up with the other Nest imports for consistency (e.g., backend/src/entities/user/user.controller.ts:18).

Copilot uses AI. Check for mistakes.
@UseInterceptors(SentryInterceptor)
@Timeout()
Expand Down Expand Up @@ -187,6 +188,7 @@ export class TableController {
@ApiQuery({ name: 'perPage', required: false })
@ApiQuery({ name: 'search', required: false })
@Timeout(TimeoutDefaults.EXTENDED)
@Throttle({ default: { limit: 300, ttl: 60000 } })
@Get('/table/rows/:connectionId')
async findAllRows(
Comment on lines 189 to 193

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These endpoints are already rate-limited by the global ThrottlerGuard (configured in backend/src/app.module.ts:55-62 with limit: 200, ttl: 60000). Adding @Throttle({ default: { limit: 300, ttl: 60000 } }) here overrides that default and actually increases the allowed rate. If the intent is to “add/tighten throttling” for row retrieval, consider removing this decorator (keep global defaults) or setting a stricter per-route limit; also consider following the existing pattern of relaxing limits under isTest() to avoid test flakiness (see backend/src/entities/user/user.controller.ts:148).

Copilot uses AI. Check for mistakes.
@QueryTableName() tableName: string,
Expand Down Expand Up @@ -249,6 +251,7 @@ export class TableController {
@ApiQuery({ name: 'search', required: false })
@UseGuards(TableReadGuard)
@Timeout(TimeoutDefaults.EXTENDED)
@Throttle({ default: { limit: 300, ttl: 60000 } })
@HttpCode(HttpStatus.OK)
@Post('/table/rows/find/:connectionId')
Comment on lines 252 to 256

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This @Throttle({ default: { limit: 300, ttl: 60000 } }) overrides the global throttling defaults (backend/src/app.module.ts:55-62 uses limit: 200, ttl: 60000) and increases the permitted request rate for this route. If the goal is to add/tighten throttling on row retrieval, consider removing the override or choosing a lower per-route limit; optionally match the repo pattern of higher limits in tests via isTest() (e.g., backend/src/entities/company-info/company-info.controller.ts:214).

Copilot uses AI. Check for mistakes.
async findAllRowsWithBodyFilter(
Expand Down
Loading