• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 20091945613

10 Dec 2025 08:19AM UTC coverage: 89.03% (-1.2%) from 90.212%
20091945613

push

github

web-flow
refactor(cache): change Zerion cache keys to be per address only (#2839)

* refactor(cache): change Zerion cache keys to be per address only

Remove chainId from Zerion cache keys for balances, collectibles, and positions.
This changes the caching strategy from per-chain-per-address to per-address only,
allowing data to be shared across chains for the same address.

Cache key changes:
- Before: {chainId}_zerion_balances_{safeAddress}
- After: zerion_balances_{safeAddress}

Similar changes applied to positions and collectibles cache keys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Prettier

* refactor: remove unused chainId parameter from clear methods

Remove chainId parameter from clearBalances and clearCollectibles methods
in IBalancesApi interface and implementations. After the refactoring to
per-address cache keys, chainId is no longer needed by the API methods:

- ZerionBalancesApi uses address-only cache keys
- SafeBalancesApi uses its instance chainId variable

The repositories still accept chainId (needed to select the correct API)
but no longer pass it to the clear methods.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Fix tests: Separate unit tests from integration/e2e tests

- Renamed tests requiring real infrastructure (.spec.ts -> .integration.spec.ts or .e2e-spec.ts)
- Updated package.json Jest config to exclude integration and e2e tests from default 'yarn test' run
- Tests requiring Redis, Postgres, or full app bootstrap are now properly categorized
- All 308 unit test suites now pass without requiring external services

Renamed files:
- Redis cache service test -> integration test
- Postgres database module tests (v1 & v2) -> integration tests
- Postgres database service test -> integration test
- Auth decorator test -> e2e test
- Spaces-related controller tests -> e2e tests
- ... (continued)

2835 of 3551 branches covered (79.84%)

Branch coverage included in aggregate %.

4 of 8 new or added lines in 5 files covered. (50.0%)

199 existing lines in 34 files now uncovered.

13616 of 14927 relevant lines covered (91.22%)

564.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/modules/csv-export/v1/csv-export.controller.ts
1
import {
92✔
2
  Body,
3
  Controller,
4
  Get,
5
  Param,
6
  ParseUUIDPipe,
7
  Post,
8
} from '@nestjs/common';
9
import {
92✔
10
  ApiAcceptedResponse,
11
  ApiBody,
12
  ApiNotFoundResponse,
13
  ApiOkResponse,
14
  ApiTags,
15
} from '@nestjs/swagger';
16
import { ValidationPipe } from '@/validation/pipes/validation.pipe';
92✔
17
import { AddressSchema } from '@/validation/entities/schemas/address.schema';
92✔
18
import { NumericStringSchema } from '@/validation/entities/schemas/numeric-string.schema';
92✔
19
import { CsvExportService } from '@/modules/csv-export/v1/csv-export.service';
92✔
20
import {
92✔
21
  JobStatusDto,
22
  JobStatusErrorDto,
23
  JobStatusResponseDto,
24
} from '@/routes/jobs/entities/job-status.dto';
25
import { TransactionExportDtoSchema } from '@/modules/csv-export/v1/entities/schemas/transaction-export.dto.schema';
92✔
26
import { TransactionExportDto } from '@/modules/csv-export/v1/entities/transaction-export-request';
92✔
27
import type { Address } from 'viem';
28

29
@ApiTags('export')
30
@Controller({
31
  path: 'export',
32
  version: '1',
33
})
34
export class CsvExportController {
92✔
UNCOV
35
  constructor(private readonly csvExportService: CsvExportService) {}
×
36

37
  @ApiAcceptedResponse({ type: JobStatusDto })
38
  @ApiBody({
39
    description: 'Transaction export request',
40
    type: TransactionExportDto,
41
    required: false,
42
  })
43
  @Post('chains/:chainId/:safeAddress')
44
  async launchExport(
92✔
45
    @Param('chainId', new ValidationPipe(NumericStringSchema)) chainId: string,
46
    @Param('safeAddress', new ValidationPipe(AddressSchema))
47
    safeAddress: Address,
48
    @Body(new ValidationPipe(TransactionExportDtoSchema))
49
    exportDto?: TransactionExportDto,
50
  ): Promise<JobStatusDto> {
51
    const args = {
×
52
      chainId,
53
      safeAddress,
54
      ...exportDto,
55
    };
56
    return this.csvExportService.registerExportJob(args);
×
57
  }
58

59
  @ApiOkResponse({
60
    description: 'CSV export status retrieved successfully',
61
    type: JobStatusDto,
62
  })
63
  @ApiNotFoundResponse({
64
    description: 'CSV export not found',
65
    type: JobStatusErrorDto,
66
  })
67
  @Get('/:jobId/status')
68
  async getExportStatus(
92✔
69
    @Param('jobId', ParseUUIDPipe) jobId: string,
70
  ): Promise<JobStatusResponseDto> {
71
    return this.csvExportService.getExportJobStatus(jobId);
×
72
  }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc