gmail.js icon indicating copy to clipboard operation
gmail.js copied to clipboard

composeRoot not found error in case of cancelled compose with at least one recipient

Open kinkoazc opened this issue 1 year ago • 5 comments

When closing a compose modal, after having added at least one recipient, an error of Can't find composeRoot for [object Object] is logged in the recipient_change event handler: https://github.com/KartikTalwar/gmail.js/blob/edd1beeacf9faa9f82af7929706e95d0cd83e463/src/gmail.js#L2529

kinkoazc avatar May 04 '23 16:05 kinkoazc

I'm not sure I fully understand the scope of this bug.

From a API usage point of view, are there use-cases which does not work as expected?

josteink avatar May 25 '23 09:05 josteink

I think that, in the described use case, it is expected that no composeRoot will be found, so I don't see the point of throwing an error, making you wonder if something is indeed not ok in/with your code.

kinkoazc avatar May 25 '23 13:05 kinkoazc

In that case, I guess "error" is more severe than it needs to be. But it could be because of something unexpected happening too.

How about warning instead of error?

josteink avatar May 25 '23 14:05 josteink

Yes, that is a good idea. But only for the cases other than compose close(not sure how this case can be identified among the others, but this would be the ideal behavior).

kinkoazc avatar May 25 '23 17:05 kinkoazc

Feel free to give it a try. PRs welcome 🙂

josteink avatar May 26 '23 18:05 josteink