Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replies to bookmarks not being stored in database #141

Closed
jeffsikes opened this issue Oct 7, 2023 · 1 comment
Closed

Replies to bookmarks not being stored in database #141

jeffsikes opened this issue Oct 7, 2023 · 1 comment

Comments

@jeffsikes
Copy link
Contributor

Hi! Really enjoying this platform and it's been a great way to learn more about ActivityPub.

When someone replies to my bookmark post, I noticed I wasn't getting any comments in the approval section. In fact, they weren't getting added at all.

No one else has mentioned this, but I've searched through other postmarkie sites and I don't see any publicly approved comments, at least.

After some debugging, I found that the ActvitiyPub inbox received the replies, but it was returning the response “couldn't find a bookmark this message is related to”.

This is what I found.

In the ActivityPub SqlLite database, the Guids were getting saved with the "m/" part of the url path along with the Guid in the messages.guid column. For example, m/ebff578a49b2095e94e8aa64c4c5d347

When a new comment comes in, it wasn't looking for the "m/" part and therefore failing to find the related post and get attached to.

It came down to this regex pattern in the src/activitypub.js file. When I updated it, new bookmarks now get saved excluding the “m/“, and the replies are matching to an entry and applied correctly. Below is the updated version.

return urlString.match(/m\/([a-zA-Z0-9+/]+)/)[1];

The updated version:

function getGuidFromPermalink(urlString) {

return urlString.match(/(?:\/m\/)([a-zA-Z0-9+/]+)/)[1];

}

I've made this change and will attach this issue to the pull request.

@ckolderup
Copy link
Owner

fixed by #142.

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

No branches or pull requests

2 participants