Skip to content

Commit 0f8f9d4

Browse files
author
teable-bot
committed
[sync] Fix Sentry Release (T1750) (#1094)
Synced from teableio/teable-ee@d43bb45
1 parent afb5f32 commit 0f8f9d4

File tree

138 files changed

+5362
-2065
lines changed

Some content is hidden

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

138 files changed

+5362
-2065
lines changed

.github/workflows/docker-push.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919

2020
jobs:
2121
build-push:
22-
runs-on: ubuntu-latest
2322
strategy:
2423
matrix:
2524
target: [app, db-migrate]
@@ -31,6 +30,11 @@ jobs:
3130
- target: db-migrate
3231
file: Dockerfile.db-migrate
3332
image: teable-db-migrate-community
33+
- arch: amd64
34+
runner: ubuntu-latest
35+
- arch: arm64
36+
runner: ubuntu-24.04-arm
37+
runs-on: ${{ matrix.runner }}
3438

3539
steps:
3640
- name: Checkout code
@@ -74,9 +78,6 @@ jobs:
7478
type=sha,format=long
7579
type=raw,value=latest
7680
77-
- name: ⚙️ Set up QEMU
78-
uses: docker/setup-qemu-action@v3
79-
8081
- name: 📦 Build and push
8182
run: |
8283
zx scripts/build-image.mjs --file=dockers/teable/${{ matrix.file }} \

.github/workflows/templates/preview-template.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ spec:
179179
- name: BACKEND_CACHE_REDIS_URI
180180
value: >-
181181
redis://$(REDIS_USERNAME):$(REDIS_PASSWORD)@$(REDIS_HOST).ns-__NAMESPACE__.svc:$(REDIS_PORT)/1
182-
- name: NEXT_ENV_IMAGES_ALL_REMOTE
183-
value: 'true'
184182
resources:
185183
requests:
186184
cpu: 200m

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ node_modules
2929
/build
3030
/dist/
3131

32+
# Next.js auto-generated type definitions
33+
**/next-env.d.ts
34+
3235
# Cache
3336
*.tsbuildinfo
3437
**/.eslintcache

apps/nestjs-backend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"dotenv-flow-cli": "1.1.1",
9999
"es-check": "7.1.1",
100100
"eslint": "8.57.0",
101-
"eslint-config-next": "14.2.14",
101+
"eslint-config-next": "15.5.9",
102102
"get-tsconfig": "4.7.3",
103103
"istanbul-merge": "2.0.0",
104104
"npm-run-all2": "6.1.2",
@@ -138,7 +138,7 @@
138138
"@keyv/sqlite": "3.6.7",
139139
"@nestjs-modules/mailer": "1.11.2",
140140
"@nestjs/axios": "3.0.2",
141-
"@nestjs/bullmq": "10.2.1",
141+
"@nestjs/bullmq": "11.0.4",
142142
"@nestjs/common": "10.3.5",
143143
"@nestjs/config": "3.2.1",
144144
"@nestjs/core": "10.3.5",
@@ -179,7 +179,7 @@
179179
"archiver": "7.0.1",
180180
"axios": "1.7.7",
181181
"bcrypt": "5.1.1",
182-
"bullmq": "5.21.2",
182+
"bullmq": "5.66.5",
183183
"class-transformer": "0.5.1",
184184
"class-validator": "0.14.1",
185185
"cookie": "0.6.0",
@@ -197,7 +197,7 @@
197197
"handlebars": "4.7.8",
198198
"helmet": "7.1.0",
199199
"http-proxy-middleware": "3.0.3",
200-
"ioredis": "5.4.1",
200+
"ioredis": "5.9.1",
201201
"is-port-reachable": "3.1.0",
202202
"joi": "17.12.2",
203203
"keyv": "4.5.4",
@@ -213,7 +213,7 @@
213213
"nestjs-i18n": "10.5.1",
214214
"nestjs-pino": "4.4.1",
215215
"nestjs-redoc": "2.2.2",
216-
"next": "14.2.35",
216+
"next": "16.1.3",
217217
"node-fetch": "2.7.0",
218218
"node-sql-parser": "5.3.8",
219219
"nodemailer": "6.9.13",

apps/nestjs-backend/src/configs/threshold.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export const thresholdConfig = registerAs('threshold', () => ({
2525
maxOpenapiAttachmentUploadSize: Number(
2626
process.env.MAX_OPENAPI_ATTACHMENT_UPLOAD_SIZE ?? Infinity
2727
),
28+
webhook: {
29+
bodyLimitBytes: Number(process.env.WEBHOOK_BODY_LIMIT_BYTES ?? 4 * 1024 * 1024),
30+
baseRateLimit: Number(process.env.WEBHOOK_BASE_RATE_LIMIT ?? 50),
31+
workflowRateLimit: Number(process.env.WEBHOOK_WORKFLOW_RATE_LIMIT ?? 2),
32+
},
2833
dbDeadlock: {
2934
maxRetries: Number(process.env.BACKEND_DB_DEADLOCK_MAX_RETRIES ?? 3),
3035
initialBackoff: Number(process.env.BACKEND_DB_DEADLOCK_INITIAL_BACKOFF ?? 100),

apps/nestjs-backend/src/custom.exception.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const getDefaultCodeByStatus = (status: HttpStatus) => {
3939
return HttpErrorCode.DATABASE_CONNECTION_UNAVAILABLE;
4040
case HttpStatus.REQUEST_TIMEOUT:
4141
return HttpErrorCode.REQUEST_TIMEOUT;
42+
case HttpStatus.PAYLOAD_TOO_LARGE:
43+
return HttpErrorCode.PAYLOAD_TOO_LARGE;
4244
default:
4345
return HttpErrorCode.UNKNOWN_ERROR_CODE;
4446
}

apps/nestjs-backend/src/db-provider/filter-query/postgres/cell-value-filter/single-value/json-cell-value-filter.adapter.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ export class JsonCellValueFilterAdapter extends CellValueFilterPostgres {
2727
const ref = this.resolveFieldReference(value);
2828

2929
if (isUserOrLink(type)) {
30+
const referenceField = this.getComparableReferenceField(value);
31+
if (referenceField.isMultipleCellValue) {
32+
const leftIdExpr = `jsonb_extract_path_text(${this.tableColumnRef}::jsonb, 'id')`;
33+
const refArrayExpr = `jsonb_path_query_array(COALESCE(${ref}, '[]'::jsonb), '$[*].id')`;
34+
builderClient.whereRaw(
35+
`EXISTS (SELECT 1 FROM jsonb_array_elements_text(${refArrayExpr}) AS ref_id WHERE ref_id = ${leftIdExpr})`
36+
);
37+
return builderClient;
38+
}
3039
builderClient.whereRaw(
3140
`jsonb_extract_path_text(${this.tableColumnRef}::jsonb, 'id') = jsonb_extract_path_text(${ref}::jsonb, 'id')`
3241
);
@@ -61,6 +70,15 @@ export class JsonCellValueFilterAdapter extends CellValueFilterPostgres {
6170
const ref = this.resolveFieldReference(value);
6271

6372
if (isUserOrLink(type)) {
73+
const referenceField = this.getComparableReferenceField(value);
74+
if (referenceField.isMultipleCellValue) {
75+
const leftIdExpr = `jsonb_extract_path_text(${this.tableColumnRef}::jsonb, 'id')`;
76+
const refArrayExpr = `jsonb_path_query_array(COALESCE(${ref}, '[]'::jsonb), '$[*].id')`;
77+
builderClient.whereRaw(
78+
`NOT EXISTS (SELECT 1 FROM jsonb_array_elements_text(${refArrayExpr}) AS ref_id WHERE ref_id = ${leftIdExpr})`
79+
);
80+
return builderClient;
81+
}
6482
builderClient.whereRaw(
6583
`jsonb_extract_path_text(${this.tableColumnRef}::jsonb, 'id') IS DISTINCT FROM jsonb_extract_path_text(${ref}::jsonb, 'id')`
6684
);

apps/nestjs-backend/src/db-provider/filter-query/sqlite/cell-value-filter/single-value/json-cell-value-filter.adapter.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export class JsonCellValueFilterAdapter extends CellValueFilterSqlite {
2727
this.field.type
2828
)
2929
) {
30+
const referenceField = this.getComparableReferenceField(value);
31+
if (referenceField.isMultipleCellValue) {
32+
const refColumn = "json_extract(json_each.value, '$.id')";
33+
builderClient.whereRaw(
34+
`exists (select 1 from json_each(${ref}) where lower(${refColumn}) = lower(${jsonColumn}))`
35+
);
36+
return builderClient;
37+
}
3038
const refColumn = `json_extract(${ref}, '$.id')`;
3139
builderClient.whereRaw(`lower(${jsonColumn}) = lower(${refColumn})`);
3240
return builderClient;
@@ -56,6 +64,14 @@ export class JsonCellValueFilterAdapter extends CellValueFilterSqlite {
5664
this.field.type
5765
)
5866
) {
67+
const referenceField = this.getComparableReferenceField(value);
68+
if (referenceField.isMultipleCellValue) {
69+
const refColumn = "json_extract(json_each.value, '$.id')";
70+
builderClient.whereRaw(
71+
`not exists (select 1 from json_each(${ref}) where lower(${refColumn}) = lower(${jsonColumn}))`
72+
);
73+
return builderClient;
74+
}
5975
const refColumn = `json_extract(${ref}, '$.id')`;
6076
builderClient.whereRaw(`lower(ifnull(${jsonColumn}, '')) != lower(${refColumn})`);
6177
return builderClient;

apps/nestjs-backend/src/event-emitter/event-job/fallback/fallback-queue.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class FallbackQueueService implements OnModuleInit {
5252
});
5353
}
5454

55-
private handleListener(
55+
private async handleListener(
5656
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5757
wrapper: InstanceWrapper,
5858
job: Job<unknown>
@@ -63,6 +63,10 @@ export class FallbackQueueService implements OnModuleInit {
6363
this.logger.warn(`${instance.constructor.name} has no method ${methodName}`);
6464
return;
6565
}
66-
instance[methodName].call(instance, job);
66+
try {
67+
await instance[methodName].call(instance, job);
68+
} catch (error) {
69+
this.logger.error(`Error processing job ${job.name}:`, error);
70+
}
6771
}
6872
}

apps/nestjs-backend/src/features/auth/guard/base-node-permission.guard.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
checkBaseNodePermission,
1212
checkBaseNodePermissionCreate,
1313
} from '../../base-node/base-node.permission.helper';
14+
import type { IBaseNodePermissionContext } from '../../base-node/types';
1415
import { BaseNodeAction } from '../../base-node/types';
1516
import { BASE_NODE_PERMISSIONS_KEY } from '../decorators/base-node-permissions.decorator';
1617
import { IS_DISABLED_PERMISSION } from '../decorators/disabled-permission.decorator';
@@ -59,10 +60,7 @@ export class BaseNodePermissionGuard extends PermissionGuard {
5960
async checkActivate(
6061
context: ExecutionContext,
6162
baseId: string,
62-
permissionContext: {
63-
permissionSet: Set<string>;
64-
tablePermissionMap?: Record<string, string[]>;
65-
}
63+
permissionContext: IBaseNodePermissionContext
6664
) {
6765
const baseNodePermissions = this.reflectorInner.getAllAndOverride<BaseNodeAction[] | undefined>(
6866
BASE_NODE_PERMISSIONS_KEY,

0 commit comments

Comments
 (0)