Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!