atom / teletype

Share your workspace with team members and collaborate on code in real time in Atom
https://teletype.atom.io
MIT License
2.41k stars 324 forks source link

Ensure package handles expired ICE server credentials #48

Open jasonrudolph opened 7 years ago

jasonrudolph commented 7 years ago

In the real-time package, we create and memoize a single RealTimeClient instance. The RealTimeClient instance creates a PeerPool instance. The PeerPool instance fetches the current ICE server URLs/credentials, and stores them for the life of the PeerPool instance. However, the ICE server URLs/credentials expire within 24 hours [1].

With this context in mind, I wonder what happens if you open an Atom instance, leave it open for more than 24 hours, and then try to share or join a portal. I suspect that any attempt to access the ICE server URLs would fail.

@nathansobo: Does that ☝️ sound right? If so, I'm guessing that we'll need some way for the RealTimeClient to ensure that it always has fresh (i.e., not-yet-expired) ICE server URLs/credentials.


[1] Twilio API docs: https://www.twilio.com/docs/api/rest/token

nathansobo commented 7 years ago

Great thinking! We probably need to pass the TTL on to the client so it can be conservative about expiring its credentials as well.