-
-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and add tests for duplicate hook calls on paginated requests #1374
Conversation
All fixed now. Your thoughts? |
I'll review this on Sunday. I'm away from home now. |
All good! Enjoy your time out 😊 |
I figured out why this happens. It's because you call Line 206 in a3e171c
And calls Line 227 in a3e171c
Currently I'm on my way back, I'll be home in 7h. This fix is not correct, it should be in |
Thanks for your help. From what I see, the main purpose of this line is to make sure the pagination options are normalised for use in Line 206 in a3e171c
So we can just use Lines 259 to 263 in a3e171c
Thats my proposed solution. What do you think? Also, I modified the tests here to match the function signature Line 553 in a3e171c
Line 358 in a3e171c
I don't know why the ci is failing, cause it passed on my own repo. |
Thanks for the tests ❤️ Fixed in e02845f |
Resolves #1367 ✨
Modified the options normaliser to check for duplicate hooks before concatenating arrays.
Following up from my comment on the issue, I decided to just filter the array instead of setting some sort of flag to indicate duplicated hooks.
I also added two tests for this specific scenario 😇 Wasn't really sure where to put it (hooks or pagination?) so I made a new file.
Checklist