CaravanStudios / open-product-recovery

Apache License 2.0
26 stars 20 forks source link

Break out local vs. remote event types #93

Open ryckmanat opened 1 year ago

ryckmanat commented 1 year ago

Today, we're a little inconsistent about event types. ADD, UPDATE, and DELETE fire when those happen on either the remote server or the local server. We also have "ACCEPT" for when an offer from the local node has been accepted, and "REMOTE_ACCEPT" for when the local node itself has accepted an offer from somewhere else.

These should probably be tweaked a bit so that we separate out local vs. remote events and are consistent with them all. "LOCAL" could prefix things involving an offer from the current/local host, whereas "REMOTE" could prefix events that happen with offers from other hosts.

Perhaps a set like this:

LOCAL_ADD: Local host/tenant creates a new offer (like through one of its offer producers) REMOTE_ADD: A new offer is discovered on a remote node (like by calling /list during ingestion) LOCAL_UPDATE: Local host/tenant updates an existing offer REMOTE_UPDATE: A remote offer has been updated LOCAL_DELETE: Local host/tenant deletes one of its offers REMOTE_DELETE: A remote offer has been deleted LOCAL_ACCEPT: An offer on the local host/tenant has been accepted by a different node/tenant. REMOTE_ACCEPT: The local host/tenant has successfully accepted an offer from a different host. LOCAL_REJECT: An offer on the local host/tenant has been rejected by a different node/tenant. REMOTE_REJECT: The local host/tenant has successfully rejected an offer from a different host. LOCAL_RESERVE: An offer on the local host/tenant has been reserved by a different node/tenant. REMOTE_RESERVE: The local host/tenant has successfully reserved an offer from a different host.