Skip to content

Improve alt IP reporting flow #684

@MartinKolarik

Description

@MartinKolarik

Related to #649 (comment). The current flow works fine for reporting "it works" case, but wouldn't work for reporting "it no longer works" case (if a request times out and the IP was previously registered, it won't be removed).

Here's an idea for an alternative approach that fixes this and also seems more reliable than what we do now:

  1. A probe makes a POST request to our API endpoint. There is no token in the request. Instead, there's a token + IP in the response. The API doesn't add the alt IP at this step, it simply stores the token + IP pair in redis.
  2. The probe then reports via its existing websocket connection that either a) the IP worked, and sends the token to prove it b) the IP didn't work.
  3. The API adds/removes the IP based on the WebSocket message.

This way, we also don't need any "synced list remote updates" because the writes are always done by the node that owns the probe, and step 1 doesn't need probe info at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions