Closed johanforssell closed 6 years ago
Thanks for the quick update :smile:
I still think the check for res.error might be wrong --- shouldn't it be !res.error
?
My thinking is that the .map()
goes through the array of results. Where there is an error, pick the token from the other array. Otherwise, pick nothing/null. Remember, we're collecting the tokens of erronous sends, in order to purge them from the database.
Ah yes, you are absolutely right, I was just reading it wrong! I blame being tired :smile:
Maybe we could avoid people like me misunderstanding the code in the future by adding a bit more of a comment?
This looks good to me! Remember to add yourself to contributors in package.json :smile:
@eladnava any comments on this before we merge?
Just reviewed, looks good to me! 💯 Thanks so much @johanforssell for the excellent work.
Thanks for the contribution @johanforssell ! :smile:
Example of how to find the tokens which you couldn't send to. I'm maching the two arrays together and then filtering it to get a list of tokens.