feathers-sequelize icon indicating copy to clipboard operation
feathers-sequelize copied to clipboard

fix multi-patch with default pagination

Open fratzinger opened this issue 4 years ago • 2 comments

See #363. I consider this quite hacky but it would solve my problem with multi-patch for a length of items > 10 for now. I would prefer to get this added to @feathersjs/adapter-tests and @feathersjs/adapter-commons (see issue #363) but wait the opinion of others on this.

fratzinger avatar Apr 06 '21 22:04 fratzinger

I'd like to get this released as well but I'm wondering if this might be a breaking change. Either that or nobody is using this functionality? 🤷

daffl avatar Oct 14 '21 23:10 daffl

I have mixed feelings about this, too. I know scenarios where this definitely is a breaking change.

My scenario is: On multi patch, use a before-hook with find (not explicitely not _find) with the exact same params to determine which records will be affected for some reasons. So find and patch/remove have to return the exact same records.

This is a reason against automatic paginate: false in patch (as suggested in this PR), because find by default would return max. 10 records and patch would return all records.

My current way to go is an early app.hooks.ts-before-hook for patch/remove that sets paginate: false if it's not set. This way my scenario works because it returns the same for find and patch.

That being said. I think this behavior should be the same for all 'major' adapters. I will see if I can come up with a test in @feathersjs/adapter-tests that can used in all adapters. When we have that and are clear that all adapters act the same, I think, we should add a note to the feathers.js main docs as a Important or Note quote.

fratzinger avatar Oct 15 '21 13:10 fratzinger