Skip to content

getFromCache method throws error #11635

@simon1389

Description

@simon1389

Issue description

getFromCache method in RedisQueryResultCache throws error since version-check

Expected Behavior

the new version of typeorm library should work with the new version-check in the getFromCache function.

Actual Behavior

Since the check of the redis-version being in place ( if (this.isRedis5OrHigher()) { ) this method throws an error when used in a nestjs application using typeorm.
Error thrown: TypeError: Cannot read properties of undefined (reading 'then') TypeError: Cannot read properties of undefined (reading 'then')

Seems the client.get function does not return a promise

Steps to reproduce

Use typeorm version 0.3.26 in a nestjs application with nestjs/typeorm
try to load a cached value via dataSource.queryResultCache.getFromCache

--> error is thrown

My Environment

Dependency Version
Operating System
Node.js version 20
Typescript version ^5.2.2
TypeORM version ^0.3.20

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions