Error when emails is undefined
alisterscott opened this issue · comments
Occasional error in CircleCI:
Cannot read property 'html' of undefined
example: https://circleci.com/gh/Automattic/wp-e2e-tests/19873#tests/containers/1
@Stojdza I saw this recently, would it be something to do with promises in the email client? Any ideas about how we'd fix this, or workaround it?
I think I know the reason. The issue comes from #pollEmailsByRecipient
and its validator. The current validator allows exiting polling on the first try. Replacing validator with something like this: emails => emails.length > 0
should potentially fix this issue.
This should be fixed by #1223
Thanks @abidhahmed!