Skip to content

Commit 34243ea

Browse files
committed
Merge branch 'develop' into contracts-v2
2 parents 5bd2911 + 3dc039a commit 34243ea

File tree

36 files changed

+988
-818
lines changed

36 files changed

+988
-818
lines changed

.github/workflows/ci-dependency-review.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
steps:
1515
- uses: actions/[email protected]
1616
- name: Dependency Review
17-
uses: actions/[email protected].1
17+
uses: actions/[email protected].2
1818
with:
1919
show-openssf-scorecard: false

packages/apps/dashboard/client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"axios": "^1.7.2",
3333
"clsx": "^2.1.1",
3434
"dayjs": "^1.11.11",
35-
"react": "^18.2.0",
36-
"react-dom": "^18.2.0",
35+
"react": "^18.3.1",
36+
"react-dom": "^18.3.1",
3737
"react-number-format": "^5.4.3",
3838
"react-router-dom": "^6.23.1",
3939
"recharts": "^2.13.0-alpha.4",
@@ -47,8 +47,8 @@
4747
},
4848
"devDependencies": {
4949
"@eslint/js": "^9.27.0",
50-
"@types/react": "^18.2.66",
51-
"@types/react-dom": "^18.2.22",
50+
"@types/react": "^18.3.12",
51+
"@types/react-dom": "^18.3.1",
5252
"@typescript-eslint/eslint-plugin": "^7.2.0",
5353
"@typescript-eslint/parser": "^7.2.0",
5454
"@vitejs/plugin-react": "^4.2.1",

packages/apps/faucet/client/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
"@human-protocol/sdk": "workspace:*",
99
"@mui/icons-material": "^7.0.1",
1010
"@mui/material": "^5.16.7",
11-
"react": "^18.2.0",
12-
"react-dom": "^18.2.0",
11+
"react": "^18.3.1",
12+
"react-dom": "^18.3.1",
1313
"react-loading-skeleton": "^3.3.1",
1414
"react-router-dom": "^6.4.3",
1515
"serve": "^14.2.4",
1616
"viem": "2.x"
1717
},
1818
"devDependencies": {
1919
"@types/react": "^18.3.12",
20+
"@types/react-dom": "^18.3.1",
2021
"dotenv": "^17.0.0",
2122
"eslint": "^8.55.0",
2223
"eslint-config-react-app": "^7.0.1",

packages/apps/fortune/exchange-oracle/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"devDependencies": {
4848
"@types/react": "^18.3.12",
49-
"@types/react-dom": "^18.3.0",
49+
"@types/react-dom": "^18.3.1",
5050
"@types/react-router-dom": "^5.3.3",
5151
"@typescript-eslint/eslint-plugin": "^7.13.1",
5252
"@typescript-eslint/parser": "^7.13.1",

packages/apps/human-app/frontend/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"notistack": "^3.0.1",
4444
"prop-types": "^15.8.1",
4545
"query-string": "^9.0.0",
46-
"react": "^18.2.0",
47-
"react-dom": "^18.2.0",
48-
"react-hook-form": "^7.55.0",
46+
"react": "^18.3.1",
47+
"react-dom": "^18.3.1",
48+
"react-hook-form": "^7.62.0",
4949
"react-i18next": "^15.1.0",
5050
"react-imask": "^7.4.0",
5151
"react-number-format": "^5.4.3",
@@ -65,7 +65,7 @@
6565
"@types/node": "^22.10.5",
6666
"@types/prop-types": "^15",
6767
"@types/react": "^18.3.12",
68-
"@types/react-dom": "^18.2.17",
68+
"@types/react-dom": "^18.3.1",
6969
"@typescript-eslint/eslint-plugin": "^6.20.0",
7070
"@typescript-eslint/parser": "^6.20.0",
7171
"@vercel/style-guide": "^6.0.0",

packages/apps/human-app/frontend/src/modules/smart-contracts/EthKVStore/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export enum JobType {
1414
SKELETONS_FROM_BOUNDING_BOXES = 'image_skeletons_from_boxes',
1515
POLYGONS = 'image_polygons',
1616
AUDIO_TRANSCRIPTION = 'audio_transcription',
17+
AUDIO_ATTRIBUTE_ANNOTATION = 'audio_attribute_annotation',
1718
}
1819

1920
export const EthKVStoreKeys = {

packages/apps/human-app/frontend/src/shared/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@
436436
"image_boxes_from_points": "Bounding Boxes from Points",
437437
"image_skeletons_from_boxes": "Skeletons from Bounding Boxes",
438438
"image_polygons": "Polygons",
439-
"audio_transcription": "Audio Transcription"
439+
"audio_transcription": "Audio Transcription",
440+
"audio_attribute_annotation": "Audio Attribute Annotation"
440441
}
441442
}

packages/apps/human-app/server/src/app.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const JOI_BOOLEAN_STRING_SCHEMA = Joi.string().valid('true', 'false');
110110
CACHE_TTL_ORACLE_AVAILABLE_JOBS: Joi.number(),
111111
JOB_ASSIGNMENTS_DATA_RETENTION_DAYS: Joi.number(),
112112
CACHE_TTL_EXCHANGE_ORACLE_URL: Joi.number(),
113+
CACHE_TTL_PROPOSALS: Joi.number(),
113114
CACHE_TTL_EXCHANGE_ORACLE_REGISTRATION_NEEDED: Joi.number(),
114115
MAX_EXECUTIONS_TO_SKIP: Joi.number(),
115116
FEATURE_FLAG_JOBS_DISCOVERY: JOI_BOOLEAN_STRING_SCHEMA,

packages/apps/human-app/server/src/common/config/environment-config.service.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const DEFAULT_CACHE_TTL_EXCHANGE_ORACLE_URL = 24 * 60 * 60;
1616
const DEFAULT_MAX_EXECUTIONS_TO_SKIP = 32;
1717
const DEFAULT_CACHE_TTL_JOB_TYPES = 24 * 60 * 60;
1818
const DEFAULT_CACHE_TTL_EXCHANGE_ORACLE_REGISTRATION_NEEDED = 24 * 60 * 60;
19+
const DEFAULT_CACHE_TTL_PROPOSALS = 5 * 60;
1920

2021
@Injectable()
2122
export class EnvironmentConfigService {
@@ -208,6 +209,19 @@ export class EnvironmentConfigService {
208209
return this.configService.getOrThrow<string>('GOVERNOR_ADDRESS');
209210
}
210211

212+
/**
213+
* The cache time-to-live (TTL) for proposals data.
214+
* Default: 5 minutes
215+
*/
216+
get cacheTtlProposals(): number {
217+
return (
218+
this.configService.get<number>(
219+
'CACHE_TTL_PROPOSALS',
220+
DEFAULT_CACHE_TTL_PROPOSALS,
221+
) * 1000
222+
);
223+
}
224+
211225
/**
212226
* Flag indicating if CORS is enabled.
213227
* Default: false

packages/apps/human-app/server/src/common/filter/exceptions.filter.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,27 @@ export class ExceptionFilter implements IExceptionFilter {
2424
if (exception instanceof HttpException) {
2525
status = exception.getStatus();
2626
message = exception.getResponse();
27-
} else if (exception.response) {
28-
status = exception.response.status;
29-
message =
30-
exception.response.data?.message || exception.response.statusText;
31-
} else {
32-
let formattedError = exception;
33-
if (exception instanceof AxiosError) {
34-
formattedError = errorUtils.formatError(exception);
35-
formattedError.outgoingRequestUrl = exception.config?.url;
27+
} else if (exception instanceof AxiosError) {
28+
/**
29+
* All requests we made to external services are supposed to be made by axios,
30+
* and we either proxy response code or act as a "bad gateway" if sending fails.
31+
*/
32+
status = exception.response?.status || HttpStatus.BAD_GATEWAY;
33+
if (status >= 200 && status < 400) {
34+
/**
35+
* In case some 3rd party that we are using (e.g. graphql client)
36+
* throws with such status code (their API schema can be literally anything)
37+
*/
38+
this.logger.warn('Unexpected http status in exception response', {
39+
status,
40+
error: errorUtils.formatError(exception),
41+
path: request.url,
42+
});
3643
}
44+
message = exception.response?.data?.message || 'Bad gateway';
45+
} else {
3746
this.logger.error('Unhandled exception', {
38-
error: formattedError,
47+
error: errorUtils.formatError(exception),
3948
path: request.url,
4049
});
4150
}

0 commit comments

Comments
 (0)