Skip to content

Commit

Permalink
resolve fixmes
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocynicys committed Oct 6, 2024
1 parent 91d98ed commit 868ee2c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion mm2src/mm2_main/src/rpc/streaming_activations/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ pub async fn enable_balance(
let streamer = TendermintBalanceEventStreamer::new(coin.clone());
ctx.event_stream_manager.add(client_id, streamer, coin.spawner()).await
},
// FIXME: What about tokens?!
_ => Err(BalanceStreamingRequestError::CoinNotSupported)?,
};

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/rpc/streaming_activations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct EnableStreamingRequest<T> {
/// The success/ok response for any event streaming activation request.
pub struct EnableStreamingResponse {
pub streamer_id: String,
// FIXME: If the the streamer was already running, it is probably running with different configuration.
// TODO: If the the streamer was already running, it is probably running with different configuration.
// We might want to inform the client that the configuration they asked for wasn't applied and return
// the active configuration instead?
// pub config: Json,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ pub async fn enable_tx_history(
let streamer = ZCoinTxHistoryEventStreamer::new(coin.clone());
ctx.event_stream_manager.add(client_id, streamer, coin.spawner()).await
},
// FIXME: What about tokens?!
_ => Err(TxHistoryStreamingRequestError::CoinNotSupported)?,
};

Expand Down
6 changes: 1 addition & 5 deletions mm2src/mm2_net/src/event_streaming/sse_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ pub async fn handle_sse(request: Request<Body>, ctx_h: u32) -> Result<Response<B

let event_stream_manager = ctx.event_stream_manager.clone();
let Ok(mut rx) = event_stream_manager.new_client(client_id) else {
// FIXME: Such an error means that one client generated an id that is already in use
// by another (or it might be the same client all along). This is dangerous since
// that client now knows this id is in use and can open up and shut down streamers
// on the original id owner's behalf.
return handle_internal_error(format!("Bad id")).await
return handle_internal_error(format!("ID already in use")).await
};
let body = Body::wrap_stream(async_stream::stream! {
while let Some(event) = rx.recv().await {
Expand Down

0 comments on commit 868ee2c

Please sign in to comment.