-
Notifications
You must be signed in to change notification settings - Fork 2
sync::from_latest and latest Modes Should Return Notification::NoPastLogsFound Instead Of Empty Vec #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This reverts commit b1718ad.
LeoPatOZ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good 👍
| if collected.is_empty() { | ||
| info!("No logs found"); | ||
| _ = sender.try_stream(Notification::NoPastLogsFound).await; | ||
| } else { | ||
| info!(count = collected.len(), "Logs found"); | ||
| collected.reverse(); // restore chronological order | ||
| } | ||
|
|
||
| info!("Sending collected logs to consumer"); | ||
| _ = sender.try_stream(collected).await; | ||
| info!("Sending collected logs to consumer"); | ||
| _ = sender.try_stream(collected).await; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| if collected.is_empty() { | |
| info!("No logs found"); | |
| _ = sender.try_stream(Notification::NoPastLogsFound).await; | |
| } else { | |
| info!(count = collected.len(), "Logs found"); | |
| collected.reverse(); // restore chronological order | |
| } | |
| info!("Sending collected logs to consumer"); | |
| _ = sender.try_stream(collected).await; | |
| info!("Sending collected logs to consumer"); | |
| _ = sender.try_stream(collected).await; | |
| } | |
| if collected.is_empty() { | |
| info!("No logs found"); | |
| _ = sender.try_stream(Notification::NoPastLogsFound).await; | |
| break; | |
| } | |
| info!(count = collected.len(), "Logs found"); | |
| collected.reverse(); // restore chronological order | |
| info!("Sending collected logs to consumer"); | |
| _ = sender.try_stream(collected).await; | |
| } |
| #[derive(Debug, Clone)] | ||
| /// Messages streamed by the scanner to subscribers. | ||
| /// | ||
| /// Each message represents either data (logs), an error, or a notification about the scanner's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| /// Each message represents either data (logs), an error, or a notification about the scanner's | |
| /// Each message represents either data or a notification about the scanner's |
No more error :D
Also not always logs?
| /// Data streamed to the subscriber. | ||
| Data(T), | ||
|
|
||
| /// Notification about scanner state changes or important events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Also wonder how useful these are
Data is self explanatory and Notification comment is the same above the notification enum
LeoPatOZ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Resolves #180
Towards #50 - added missing from/to block validation to
latestmode