0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00
ghost/test
Kevin Ansfield 8d5e7ed695
🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181)
refs https://github.com/TryGhost/Team/issues/935

The problem was incorrect operator precedence when multiple statements existed in the filter original filter when we transform it to enforce `subscribed:true` before sending.

- free only - subscribed:true+status:free - no issue
- paid only - subscribed:true+status:-free - no issue
- all - subscribed:true+status:-free,status:free - the ,status:free part is treated as a separate OR statement meaning the subscribed:true is not applied to it and free members that are unsubscribed will receive the email

- extracted the filter transform into a separate function so it can be unit tested
- updated the transform to use `()` for operator precedence, eg: `subscribed:true+(status:-free,status:free)`
- used transform function in `addEmail()` and `getEmailMemberRows()`
- fixed `sent/send` typo in error message
2021-07-26 12:47:03 +01:00
..
api-acceptance Fixed created_at dates for member events on import (#13151) 2021-07-16 12:06:46 +01:00
frontend-acceptance Renamed tests to .test.js & updated commands 2021-07-06 20:45:01 +01:00
regression Reverted "Moved disguised unit tests into regression test suite" 2021-07-19 13:22:31 +04:00
unit 🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181) 2021-07-26 12:47:03 +01:00
utils Moved labs utlity to shared 2021-07-08 09:05:41 +01:00
.eslintignore Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
.eslintrc.js Upgraded no-skipped-test rule to error 2021-05-26 14:57:43 +01:00
.jshintrc Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00