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
2 changes: 1 addition & 1 deletion .github/workflows/ci-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- name: Dependency Review
uses: actions/dependency-review-action@v4.7.1
uses: actions/dependency-review-action@v4.7.2
with:
show-openssf-scorecard: false
8 changes: 4 additions & 4 deletions packages/apps/dashboard/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"axios": "^1.7.2",
"clsx": "^2.1.1",
"dayjs": "^1.11.11",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-number-format": "^5.4.3",
"react-router-dom": "^6.23.1",
"recharts": "^2.13.0-alpha.4",
Expand All @@ -47,8 +47,8 @@
},
"devDependencies": {
"@eslint/js": "^9.27.0",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/dashboard/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cache-manager": "^5.4.0",
"cache-manager-redis-yet": "^5.1.5",
"dayjs": "^1.11.12",
"ethers": "~6.13.5",
"ethers": "~6.15.0",
"lodash": "^4.17.21",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.2.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/apps/faucet/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
"@human-protocol/sdk": "workspace:*",
"@mui/icons-material": "^7.0.1",
"@mui/material": "^5.16.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-loading-skeleton": "^3.3.1",
"react-router-dom": "^6.4.3",
"serve": "^14.2.4",
"viem": "2.x"
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"dotenv": "^17.0.0",
"eslint": "^8.55.0",
"eslint-config-react-app": "^7.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/fortune/exchange-oracle/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@tanstack/react-query": "^5.67.2",
"@tanstack/react-query-persist-client": "^5.80.7",
"axios": "^1.7.2",
"ethers": "^6.13.5",
"ethers": "^6.15.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.24.1",
Expand All @@ -46,7 +46,7 @@
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.0",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/fortune/exchange-oracle/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"class-transformer": "^0.5.1",
"class-validator": "0.14.1",
"dotenv": "^17.0.0",
"ethers": "~6.13.5",
"ethers": "~6.15.0",
"joi": "^17.13.3",
"jsonwebtoken": "^9.0.2",
"minio": "7.1.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/apps/human-app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@tanstack/react-query": "^5.75.5",
"@wagmi/core": "^2.17.1",
"date-fns": "^4.1.0",
"ethers": "^6.13.5",
"ethers": "^6.15.0",
"i18next": "^23.8.2",
"jwt-decode": "^4.0.0",
"lodash": "^4.17.21",
Expand All @@ -43,9 +43,9 @@
"notistack": "^3.0.1",
"prop-types": "^15.8.1",
"query-string": "^9.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.55.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.62.0",
"react-i18next": "^15.1.0",
"react-imask": "^7.4.0",
"react-number-format": "^5.4.3",
Expand All @@ -65,7 +65,7 @@
"@types/node": "^22.10.5",
"@types/prop-types": "^15",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.2.17",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@vercel/style-guide": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/human-app/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"cache-manager-redis-yet": "^5.1.5",
"class-transformer": "^0.5.1",
"class-validator": "0.14.1",
"ethers": "~6.13.5",
"ethers": "^6.15.0",
"joi": "^17.13.3",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/apps/human-app/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const JOI_BOOLEAN_STRING_SCHEMA = Joi.string().valid('true', 'false');
CACHE_TTL_ORACLE_AVAILABLE_JOBS: Joi.number(),
JOB_ASSIGNMENTS_DATA_RETENTION_DAYS: Joi.number(),
CACHE_TTL_EXCHANGE_ORACLE_URL: Joi.number(),
CACHE_TTL_PROPOSALS: Joi.number(),
CACHE_TTL_EXCHANGE_ORACLE_REGISTRATION_NEEDED: Joi.number(),
MAX_EXECUTIONS_TO_SKIP: Joi.number(),
FEATURE_FLAG_JOBS_DISCOVERY: JOI_BOOLEAN_STRING_SCHEMA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const DEFAULT_CACHE_TTL_EXCHANGE_ORACLE_URL = 24 * 60 * 60;
const DEFAULT_MAX_EXECUTIONS_TO_SKIP = 32;
const DEFAULT_CACHE_TTL_JOB_TYPES = 24 * 60 * 60;
const DEFAULT_CACHE_TTL_EXCHANGE_ORACLE_REGISTRATION_NEEDED = 24 * 60 * 60;
const DEFAULT_CACHE_TTL_PROPOSALS = 5 * 60;

@Injectable()
export class EnvironmentConfigService {
Expand Down Expand Up @@ -208,6 +209,19 @@ export class EnvironmentConfigService {
return this.configService.getOrThrow<string>('GOVERNOR_ADDRESS');
}

/**
* The cache time-to-live (TTL) for proposals data.
* Default: 5 minutes
*/
get cacheTtlProposals(): number {
return (
this.configService.get<number>(
'CACHE_TTL_PROPOSALS',
DEFAULT_CACHE_TTL_PROPOSALS,
) * 1000
);
}

/**
* Flag indicating if CORS is enabled.
* Default: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,27 @@ export class ExceptionFilter implements IExceptionFilter {
if (exception instanceof HttpException) {
status = exception.getStatus();
message = exception.getResponse();
} else if (exception.response) {
status = exception.response.status;
message =
exception.response.data?.message || exception.response.statusText;
} else {
let formattedError = exception;
if (exception instanceof AxiosError) {
formattedError = errorUtils.formatError(exception);
formattedError.outgoingRequestUrl = exception.config?.url;
} else if (exception instanceof AxiosError) {
/**
* All requests we made to external services are supposed to be made by axios,
* and we either proxy response code or act as a "bad gateway" if sending fails.
*/
status = exception.response?.status || HttpStatus.BAD_GATEWAY;
if (status >= 200 && status < 400) {
/**
* In case some 3rd party that we are using (e.g. graphql client)
* throws with such status code (their API schema can be literally anything)
*/
this.logger.warn('Unexpected http status in exception response', {
status,
error: errorUtils.formatError(exception),
path: request.url,
});
}
message = exception.response?.data?.message || 'Bad gateway';
} else {
this.logger.error('Unhandled exception', {
error: formattedError,
error: errorUtils.formatError(exception),
path: request.url,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class GovernanceController {
@ApiOperation({ summary: 'Get pending and active governance proposals' })
@ApiOkResponse({ type: ProposalResponse, isArray: true })
@HttpCode(200)
@Header('Cache-Control', 'private, max-age=60')
@Header('Cache-Control', 'private, max-age=300')
@Get('/proposals')
public async getProposals(): Promise<ProposalResponse[]> {
return this.governanceService.getProposals();
Expand Down
Loading
Loading