opendut icon indicating copy to clipboard operation
opendut copied to clipboard

get_peer_state() should return Down, if peer exists, but has no state associated

Open mbfm opened this issue 1 year ago • 0 comments

actions::get_peer_state() currently returns an error, if a peer has no state associated. This results in an error after a CARL restart, as we don't persist the PeerState.

Instead, it should still be an error, if the peer does not exist at all (no PeerDescriptor).
But not, if the peer exists, but has no PeerState associated. Then we would just return PeerState::Down.

Tasks:

  • [ ] Introduce unit test for get_peer_state()
  • [ ] Have the same unit test also executed for the database (ask @mbfm how to do this, who's currently preparing the same for store_peer_descriptor())
  • [ ] Adjust behavior
  • [ ] Remove resources.insert(peer_id, peer_state)? in actions::store_peer_descriptor()
  • [ ] Test that it now works in the Localenv, e.g. via the Vagrant setup. (@mbfm can do this)

mbfm avatar Aug 22 '24 13:08 mbfm