Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
Update / Patch not working in feathersjs app service with feathers-redis-cache used in hooks

I am using feathers-redis-cache in order to cache data for some of the services in my feathersjs app. This is how my hooks look like:

const {hooks: redisCache} = require('feathers-redis-cache');
///... some code ..///
before: {
    all: [],
    find: [validateSearchParams,redisCache.before()],
    get: [redisCache.before()],
    create: [throw400Error('Not supported')],
    update: [throw400Error('Not supported')],
    patch:  [preventAnyUnallowedChanges, redisCache.before()],
    remove: [throw400Error('Not supported')]
  },

  after: {
    all: [],
    find: [removeSensitiveData(), redisCache.after({ expiration: 600 })],
    get: [preventUnallowedConfig, removeSensitiveData(), redisCache.after({expiration: 600 })],
    create: [redisCache.purge()],
    update: [redisCache.purge()],
    patch: [preventUnallowedData, redisCache.purge()],
    remove: [redisCache.purge()]
  },

Now, front end is sending properly formatted data that is getting through GET call (feathersjs get) and after changing and saving data in form, PATCH (feathersjs patch) is returning old, cached data. Once I removed from before hook / patch method redisCache.before(), the patching of the data goes without problem. With that redis method in place and with fetching the data with find and not get, this problem does not exist.

Can somebody explain the reason why patching is not working if data is fetched with get and then patched and it is working when data is fetched with find?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda