• 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

83.33
/src/modules/csv-export/v1/csv-export.module.ts
1
import { JobQueueService } from '@/datasources/job-queue/job-queue.service';
92✔
2
import { JobQueueShutdownHook } from '@/datasources/job-queue/job-queue.shutdown.hook';
92✔
3
import { CSV_EXPORT_QUEUE } from '@/domain/common/entities/jobs.constants';
92✔
4
import { IJobQueueService } from '@/domain/interfaces/job-queue.interface';
92✔
5
import { ILoggingService, LoggingService } from '@/logging/logging.interface';
92✔
6
import { BullModule, getQueueToken } from '@nestjs/bullmq';
92✔
7
import { Module } from '@nestjs/common';
92✔
8
import { Queue } from 'bullmq';
9
import { CsvExportConsumer } from '@/modules/csv-export/v1/consumers/csv-export.consumer';
92✔
10
import { CsvExportController } from '@/modules/csv-export/v1/csv-export.controller';
92✔
11
import { CsvExportService } from '@/modules/csv-export/v1/csv-export.service';
92✔
12
import { ExportApiManagerModule } from '@/modules/csv-export/v1/datasources/export-api.manager.interface';
92✔
13
import { CloudStorageModule } from '@/datasources/storage/cloud-storage.module';
92✔
14
import { IConfigurationService } from '@/config/configuration.service.interface';
92✔
15
import { CsvService } from '../csv-utils/csv.service';
92✔
16

17
@Module({
18
  imports: [
19
    BullModule.registerQueueAsync({
20
      name: CSV_EXPORT_QUEUE,
UNCOV
21
      useFactory: (configService: IConfigurationService) => ({
×
22
        defaultJobOptions: {
23
          removeOnComplete: configService.get(
24
            'csvExport.queue.removeOnComplete',
25
          ),
26
          removeOnFail: configService.get('csvExport.queue.removeOnFail'),
27
          backoff: configService.get('csvExport.queue.backoff'),
28
          attempts: configService.get<number>('csvExport.queue.attempts'),
29
        },
30
      }),
31
      inject: [IConfigurationService],
32
    }),
33
    CloudStorageModule.register(
34
      'csvExport.fileStorage.aws.accessKeyId',
35
      'csvExport.fileStorage.aws.secretAccessKey',
36
      'csvExport.fileStorage.aws.bucketName',
37
      'csvExport.fileStorage.aws.basePath',
38
    ),
39
    ExportApiManagerModule,
40
  ],
41
  controllers: [CsvExportController],
42
  providers: [
43
    {
44
      provide: IJobQueueService,
45
      useFactory: (queue: Queue): IJobQueueService =>
UNCOV
46
        new JobQueueService(queue),
×
47
      inject: [getQueueToken(CSV_EXPORT_QUEUE)],
48
    },
49
    {
50
      provide: JobQueueShutdownHook,
51
      useFactory: (
52
        queue: Queue,
53
        logging: ILoggingService,
UNCOV
54
      ): JobQueueShutdownHook => new JobQueueShutdownHook(queue, logging),
×
55
      inject: [getQueueToken(CSV_EXPORT_QUEUE), LoggingService],
56
    },
57
    CsvExportConsumer,
58
    CsvExportService,
59
    CsvService,
60
  ],
61
  exports: [CsvExportService, BullModule],
62
})
63
export class CsvExportV1Module {}
92✔
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