Because Mousehole often runs as a sidecar onto other container's networks, people frequently run into problems when that other container stops and Mousehole is still attached to its network, but it has no VPN/routes/etc.
We should write ephemeral state into Mousehole's backend that keeps track of "being online", which I will define as if the last fetch to MAM threw an exception or not. Example:
// connectivitiy.ts
export let isOnline = true;
// some-handler.ts
try {
const response = await fetch(endpointUrl, { ... });
isOnline = true;
// ... rest of existing logic (parse body, validate schema, return)
} catch (error) {
isOnline = false;
throw error;
}
Again, this should be ephemeral state, so we do not need to store it.
After we get this plumbed in, we should surface it in:
- server logs immediately when it happens
- the GET
/state API endpoint
- the front end, maybe in a new row? in the status section
- websocket messages?
- also, the GET
/ok endpoint should incorporate this.
Also, update the error documentation with this.
Because Mousehole often runs as a sidecar onto other container's networks, people frequently run into problems when that other container stops and Mousehole is still attached to its network, but it has no VPN/routes/etc.
We should write ephemeral state into Mousehole's backend that keeps track of "being online", which I will define as if the last fetch to MAM threw an exception or not. Example:
Again, this should be ephemeral state, so we do not need to store it.
After we get this plumbed in, we should surface it in:
/stateAPI endpoint/okendpoint should incorporate this.Also, update the error documentation with this.