fix: update default community template url#130
Conversation
There was a problem hiding this comment.
Code Review
This pull request bumps the workspace and package versions to 0.16.2 and updates the default metadata server URL for the Esmeralda network. A critical issue was identified regarding the new URL: the absence of a trailing slash may cause the 'community-templates' path segment to be discarded during URL joining operations in the codebase, potentially breaking metadata publishing.
|
|
||
| pub const DEFAULT_WALLET_DAEMON_URL: &str = "http://127.0.0.1:5100/json_rpc"; | ||
| pub const DEFAULT_METADATA_SERVER_URL_ESMERALDA: &str = "https://ootle-templates-esme.tari.com/"; | ||
| pub const DEFAULT_METADATA_SERVER_URL_ESMERALDA: &str = "https://ootle.tari.com/community-templates"; |
There was a problem hiding this comment.
The new URL includes a path segment (/community-templates) but lacks a trailing slash. When using the url crate, Url::join will replace the last path segment of the base URL if it does not end with a slash. Additionally, the current implementation of metadata publishing (e.g., in crates/cli/src/cli/commands/metadata/publish.rs) uses .join() with a leading slash (e.g., .join("/api/...")). In the url crate, joining a string with a leading slash treats it as an absolute path from the domain root, which will cause the /community-templates segment to be discarded, resolving to https://ootle.tari.com/api/... instead. If the API is intended to be hosted under the /community-templates/ path, this change will break metadata publishing. You should add a trailing slash here and ensure that the strings passed to .join() in the publishing logic do not start with a leading slash.
| pub const DEFAULT_METADATA_SERVER_URL_ESMERALDA: &str = "https://ootle.tari.com/community-templates"; | |
| pub const DEFAULT_METADATA_SERVER_URL_ESMERALDA: &str = "https://ootle.tari.com/community-templates/"; |
Description
Motivation and Context
How Has This Been Tested?
What process can a PR reviewer use to test or verify this change?
Breaking Changes