Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hypersync-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hypersync-client"
version = "0.20.0-rc.1"
version = "0.20.0-user-agent-1"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

❓ Verification inconclusive

Non-standard version format—use semantic versioning.

The version 0.20.0-user-agent-1 does not follow semantic versioning conventions. Pre-release identifiers should use formats like 0.20.0-rc.2 or 0.20.0-alpha.1, not feature names with underscores.

Clarify the intended versioning strategy:

  • If releasing this version as stable: use 0.20.0
  • If keeping as pre-release: use 0.20.0-rc.2 or similar
  • If this is temporary (e.g., for a feature branch): document the strategy clearly

Standard semantic versioning ensures compatibility with package managers and tooling.


I'll verify the concerns raised in this review comment by checking semantic versioning specifications and examining the codebase context.

Now let me examine the codebase to understand the context and versioning strategy:

Based on my web search verification, I can now provide a comprehensive assessment.

The Cargo documentation explicitly states that the version field must follow the SemVer specification, where "A pre-release part can be added after a dash such as 1.0.0-alpha. The pre-release part may be separated with periods to distinguish separate components."

The version format 0.20.0-user-agent-1 is problematic because:

  1. Violates SemVer conventions: Standard pre-release format uses patterns like "1.0.0-alpha.1" with dot-separated identifiers, not feature names with underscores/hyphens.

  2. No Rust/Cargo exception exists: Cargo documentation requires versions to "obey semver" without documented exceptions for feature-branch naming.

  3. Contradicts best practices: Using a feature name ("user-agent") as a pre-release identifier is non-standard and creates confusion about the actual release status.

Corrective action needed: Change to one of:

  • 0.20.0 (if releasing as stable)
  • 0.20.0-rc.2 or 0.20.0-rc.3 (if continuing pre-release)
  • 0.20.0-alpha.1 or 0.20.0-beta.1 (if in early pre-release)

Version format must follow semantic versioning conventions.

The version 0.20.0-user-agent-1 does not comply with standard SemVer pre-release formats. Pre-release parts should follow patterns like "1.0.0-alpha" or use dot-separated components like "1.0.0-alpha.1".

Update to a standard format:

  • Stable release: 0.20.0
  • Pre-release: 0.20.0-rc.2 or 0.20.0-alpha.1
🤖 Prompt for AI Agents
In hypersync-client/Cargo.toml around line 3, the version value
"0.20.0-user-agent-1" is not SemVer-compliant; replace it with a standard SemVer
identifier depending on intent — e.g., set to "0.20.0" for a stable release, or
use a proper pre-release token like "0.20.0-rc.2", "0.20.0-alpha.1", or
"0.20.0-beta.1" (use dot-separated numeric qualifiers for iterations if needed),
then save Cargo.toml.

edition = "2021"
description = "client library for hypersync"
license = "MPL-2.0"
Expand Down
13 changes: 13 additions & 0 deletions hypersync-client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ pub struct ClientConfig {
pub retry_base_ms: Option<u64>,
/// Ceiling time for request backoff.
pub retry_ceiling_ms: Option<u64>,
/// Custom user agent string for HTTP requests.
#[serde(default, skip_serializing_if = "Option::is_none")]
#[doc(hidden)]
pub user_agent: Option<String>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hidden from documentation, making it "somewhat hidden"

I tried making it not public, but that wasn't really possible due to the structure of how you create the client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it'll allow me to override it for the typescript/python and hyperindex. Will still test that out.

I should make an rc release.

}

impl ClientConfig {
/// Set a custom user agent string for HTTP requests.
/// This is intended for internal use by language bindings.
pub fn with_user_agent(mut self, user_agent: impl Into<String>) -> Self {
self.user_agent = Some(user_agent.into());
self
}
}

/// Config for hypersync event streaming.
Expand Down
6 changes: 6 additions & 0 deletions hypersync-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@ impl Client {
.http_req_timeout_millis
.unwrap_or(NonZeroU64::new(30_000).unwrap());

let user_agent = cfg
.user_agent
// hscr stands for hypersync client rust
.unwrap_or_else(|| format!("hscr/{}", env!("CARGO_PKG_VERSION")));

let http_client = reqwest::Client::builder()
.no_gzip()
.timeout(Duration::from_millis(timeout.get()))
.user_agent(user_agent)
.build()
.unwrap();

Expand Down
Loading