The bsky update-profile command is currently not functioning as expected. When attempting to update the profile with a new name, an error message is returned, indicating an "InvalidSwap" issue. This problem occurs not only when updating the name, but also when updating the description, avatar, and banner.
here is the example
> ~/go/bin/bsky update-profile "new name"
cannot update profile: XRPC ERROR 400: InvalidSwap: Record was at bafyreidm72txz6wxhqjcdhtyfyvljysehxp56yvyifsryiwvaiptekgcdm
PR Description
This PR aims to fix the issues with the bsky update-profile command. The changes introduced in this PR are as follows:
The RepoPutRecord in doUpdateProfile function will be executed with SwapRecord field. The SwapRecord contains the current ID of the "app.bsky.actor.profile" before the update.
For fields that are not being updated (i.e., fields not specified by the command arguments), the current values are retained from the existing record.
A utility function has been added to retrieve the CID from the bsky.ActorGetProfile.Avatar and bsky.ActorGetProfile.Banner field.
The creation of this PR was guided by references to upsertProfile and here.
The update-profile command has been tested locally and appears to be functioning correctly.
As I'm not a regular Go developer, please feel free to adjust anything that seems out of place. Lastly, thank you for this fantastic CLI tool 🚀.
Problem Description
The
bsky update-profile
command is currently not functioning as expected. When attempting to update the profile with a new name, an error message is returned, indicating an "InvalidSwap" issue. This problem occurs not only when updating the name, but also when updating the description, avatar, and banner.here is the example
PR Description
This PR aims to fix the issues with the
bsky update-profile
command. The changes introduced in this PR are as follows:RepoPutRecord
indoUpdateProfile
function will be executed withSwapRecord
field. TheSwapRecord
contains the current ID of the "app.bsky.actor.profile" before the update.bsky.ActorGetProfile.Avatar
andbsky.ActorGetProfile.Banner
field.The creation of this PR was guided by references to upsertProfile and here. The
update-profile
command has been tested locally and appears to be functioning correctly.As I'm not a regular Go developer, please feel free to adjust anything that seems out of place. Lastly, thank you for this fantastic CLI tool 🚀.