fastify-secure-session icon indicating copy to clipboard operation
fastify-secure-session copied to clipboard

fix: monitor objects and delete property

Open Nanosync opened this issue 1 year ago • 2 comments

Fixes #217

This PR ensures changed in Session is set to true by:

  • observing modifications to objects (and recursive objects) within Session
  • observing when the delete keyword is used within Session (and recursive objects)

Checklist

Nanosync avatar Mar 24 '24 08:03 Nanosync

I still don't understand why it needs to be in module scope vs inside the plugin scope.

mcollina avatar Mar 25 '24 13:03 mcollina

@mcollina Do you mean that sessionProxyCache should be moved into the scope of fastifySecureSession? I was not aware that fastifySecureSession would be called multiple times.

Edit: I've moved its scope.

Nanosync avatar Mar 25 '24 13:03 Nanosync

I'm not sure why but the tests are now failing, I'm reverting.

https://github.com/fastify/fastify-secure-session/actions/runs/8631175011/job/23659036483#step:5:117

Feel free to open a fresh PR with this, but these kind of failures are why I generically prefer to avoid Proxy.

mcollina avatar Apr 10 '24 13:04 mcollina