KartikTalwar / gmail.js

Gmail JavaScript API
MIT License
3.75k stars 457 forks source link

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

Open kinkoazc opened 1 year ago

kinkoazc commented 1 year ago

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

josteink commented 1 year ago

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?

kinkoazc commented 1 year ago

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.

josteink commented 1 year ago

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?

kinkoazc commented 1 year ago

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).

josteink commented 1 year ago

Feel free to give it a try. PRs welcome 🙂