Skip to content

Conversation

@guidiaz
Copy link
Contributor

@guidiaz guidiaz commented Sep 10, 2025

No description provided.

@guidiaz guidiaz requested a review from aesedepece September 10, 2025 18:12
Comment on lines +1544 to +1546
let since_epoch: u32 = since_epoch.try_into().inspect_err(|&e| {
log::warn!("Invalid 'since' limit on SearchDataRequests: {e}");
})?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to fail silently here instead of returning the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the ? on L1546 make the function return with an error Result?

Comment on lines 1540 to 1543
let mut since_epoch: i64 = msg.since.unwrap_or_default();
if let Some(current) = self.current_epoch {
since_epoch = i64::from(current).saturating_add(since_epoch);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here is:

  • Use since from the arguments if provided, otherwise make it 0
  • Then if there's a current epoch (in practice, always), add current epoch to the since_epoch from before

As a result, for any given value of since greater than 0, you are guaranteed to get no results as you'd be looking for epochs in the future.

I'm assuming this logic is not correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. A default -4320i64 was rather intended.

@aesedepece
Copy link
Member

Merged as of e05b06f

@aesedepece aesedepece closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants