You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug when handling multiple facets in a post. I think the byte location shifts.
{
"record": {
"$type": "app.bsky.feed.post",
"text": "I have an open discussion topic if you want to add your thoughts on supporting 2FA in the PSBluesky #PowerShell module.",
"createdAt": "2024-11-18T18:02:15.8878051-05:00",
"facets": [
{
"index": {
"byteStart": 162,
"byteEnd": 173
},
"features": [
{
"$type": "app.bsky.richtext.facet#tag",
"tag": "PowerShell"
}
]
},
{
"index": {
"byteStart": 15,
"byteEnd": 31
},
"features": [
{
"$type": "app.bsky.richtext.facet#link",
"uri": "https://github.com/jdhitsolutions/PSBluesky/discussions/21"
}
]
}
]
},
The original string was: "I have an open [discussion topic](https://github.com/jdhitsolutions/PSBluesky/discussions/21) if you want to add your thoughts on supporting 2FA in the PSBluesky #PowerShell module."
The text was updated successfully, but these errors were encountered:
The byte offsets for tags and mentions are being calculated first. After that the record.text is being modified here which makes the offsets calculated for tags/mentions against the original record.text version, not the revised one.
You can quickly fix that by handling the markdown style links first because that's the only one mutating the original text.
The approach works until the message contains unicode characters that take more than one byte btw. It's unlikely to happen when someone is sending a message from the terminal but it can.
There is a bug when handling multiple facets in a post. I think the byte location shifts.
The original string was:
"I have an open [discussion topic](https://github.com/jdhitsolutions/PSBluesky/discussions/21) if you want to add your thoughts on supporting 2FA in the PSBluesky #PowerShell module."
The text was updated successfully, but these errors were encountered: