Skip to content

fix(aw-client-rust): make create_bucket_simple useful#331

Open
hapm wants to merge 1 commit into
ActivityWatch:masterfrom
hapm:master
Open

fix(aw-client-rust): make create_bucket_simple useful#331
hapm wants to merge 1 commit into
ActivityWatch:masterfrom
hapm:master

Conversation

@hapm

@hapm hapm commented Dec 16, 2022

Copy link
Copy Markdown

create_bucket_simple should expose the created bucket for later use. This would allow to expose the id, which can be generated based on the bucket name given and the hostname, what in turn leads to simpler creation of a new Bucket, as intended by the function.

Comment thread aw-client-rust/src/lib.rs
let bucket = Bucket {
bid: None,
id: bucketname.to_string(),
id: format!("{}_{}", bucketname, self.hostname),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a breaking change. I suggest to keep the original behavior to avoid mishaps.

Suggested change
id: format!("{}_{}", bucketname, self.hostname),
id: bucketname.to_string(),

If you want your ID with a hostname suffix, better pass a different bucketname instead of adding this assumption to the create_bucket_simple method.

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.

2 participants