HackerExperience / HEBorn

GNU Affero General Public License v3.0
56 stars 18 forks source link

Editing a bounce should break connections using that bounce #470

Open themaxhero opened 6 years ago

themaxhero commented 6 years ago

While discussing with @kress95 we had some thoughts about its implementation:

How should we check if a bounce is being used?

There are three options for that:

  1. Reference counting, anytime something uses a bounce it would do a dispatch that increments the reference count (and the reverse is also true):
    • This method is simple in theory but complex in practice, forgetting to dispatch would lead to incorrect behaviour.
    • Dispatches should happen after events, so tabs can keep correct reference counts.
    • I'm not a fan of this method, it's simple but error prone.
    • This method is the fastest to run.
  2. Checking tunnels. but they aren't properly implemented yet:
    • This method is complex and slow but fast enough for single check.
    • The code is complex depending on Tunnels implementation, if tunnels are owned by servers, the function would have to fold every server.
  3. A request would tell us if a bounce is being used or not:
    • This method is the slower to run but faster to code.
    • Using this method is a PITA, it requires two messages to perform one thing: one to ask to edit a Bounce, another to check the request response.

Should we break all active channels that use this bounce?

We're assuming that editing a bounce kills every active connection using it, but does it apply to channels? A channel using that bounce should also be killed?


@pedrohlc @renatomassaro

chrisfls commented 6 years ago

I'm leaning toward the 2nd method, but my opinion might change depending on the outcome of the later problem (or even other not discussed yet problem).