dollarshaveclub / postmate

📭 A powerful, simple, promise-based postMessage library.
MIT License
1.87k stars 184 forks source link

Missing reject after maxAttempts #231

Open BarrMan opened 2 years ago

BarrMan commented 2 years ago

What Is the issue?

Missing reject after maxAttempts. Handshake keeps hanging when max attempts reached.

Provide issue context below using code examples, images, or links

When calling Postmate with Slow 3G/Fast 3G internet connection, the connection might not be established on time. The maximum time Postmate allows is 500ms * 5attempts which is 2.5 seconds. For slower connections it might not suffice. Rejecting the promise allows the user to use some sort of handling logic.

BarrMan commented 2 years ago

Fixed at: https://github.com/dollarshaveclub/postmate/pull/230