• 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

63.64
/src/datasources/storage/cloud-storage.module.ts
1
import { IConfigurationService } from '@/config/configuration.service.interface';
92✔
2
import { AwsCloudStorageApiService } from '@/datasources/storage/aws-cloud-storage-api.service';
92✔
3
import { ICloudStorageApiService } from '@/datasources/storage/cloud-storage-api.service';
92✔
4
import {
92✔
5
  AWS_ACCESS_KEY_ID,
6
  AWS_BASE_PATH,
7
  AWS_BUCKET_NAME,
8
  AWS_SECRET_ACCESS_KEY,
9
} from '@/datasources/storage/constants';
10
import { DynamicModule, Module } from '@nestjs/common';
92✔
11

12
@Module({})
13
export class CloudStorageModule {
92✔
14
  static register(
15
    accessKeyId: string,
16
    secretAccessKey: string,
17
    bucketKey: string,
18
    basePathKey: string,
19
  ): DynamicModule {
20
    return {
184✔
21
      module: CloudStorageModule,
22
      providers: [
23
        {
24
          provide: AWS_ACCESS_KEY_ID,
25
          useFactory: (configService: IConfigurationService) =>
UNCOV
26
            configService.getOrThrow<string>(accessKeyId),
×
27
          inject: [IConfigurationService],
28
        },
29
        {
30
          provide: AWS_SECRET_ACCESS_KEY,
31
          useFactory: (configService: IConfigurationService) =>
UNCOV
32
            configService.getOrThrow<string>(secretAccessKey),
×
33
          inject: [IConfigurationService],
34
        },
35
        {
36
          provide: AWS_BUCKET_NAME,
37
          useFactory: (configService: IConfigurationService) =>
UNCOV
38
            configService.getOrThrow<string>(bucketKey),
×
39
          inject: [IConfigurationService],
40
        },
41
        {
42
          provide: AWS_BASE_PATH,
43
          useFactory: (configService: IConfigurationService) =>
UNCOV
44
            configService.getOrThrow<string>(basePathKey),
×
45
          inject: [IConfigurationService],
46
        },
47
        {
48
          provide: ICloudStorageApiService,
49
          useClass: AwsCloudStorageApiService,
50
        },
51
      ],
52
      exports: [ICloudStorageApiService],
53
    };
54
  }
55
}
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

© 2026 Coveralls, Inc