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

v0.1.10 seems to be non-backwards compatible, summary is treated as mandatory #7

Closed
dellagustin opened this issue Feb 2, 2023 · 5 comments

Comments

@dellagustin
Copy link

Hello @johnspurlock-skymethod , I started testing v0.1.10. It is now failing to get comments for Activities without summary:

There was an error on the server fetching a comment Error: Expected 'summary' to be a string, found null
    at computeLanguageTaggedValues (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:1023:11)
    at computeSummary (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:1015:10)
    at computeComment (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:970:19)
    at Object.fetchActivityPubComment [as fetchComment] (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:839:10)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async processNode (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:1441:22)
    at async processLevel (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:1305:20)
    at async updateThreadcap (C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\node_modules\threadcap\cjs\main.js:1324:3)
    at async C:\Users\guilh\Desenvolvimento\podcastindex\web-ui\server\index.js:148:5**

Related to that, I found out that it is possible to have comments with empty content / contentMap, as long as it has an attachment. You might want to check if this is supported as well.

Example: https://fosstodon.org/@dellagustin/109794075204000680

{
    "@context": [
        "https://www.w3.org/ns/activitystreams",
        {
            "ostatus": "http://ostatus.org#",
            "atomUri": "ostatus:atomUri",
            "inReplyToAtomUri": "ostatus:inReplyToAtomUri",
            "conversation": "ostatus:conversation",
            "sensitive": "as:sensitive",
            "toot": "http://joinmastodon.org/ns#",
            "votersCount": "toot:votersCount",
            "blurhash": "toot:blurhash",
            "focalPoint": {
                "@container": "@list",
                "@id": "toot:focalPoint"
            }
        }
    ],
    "id": "https://fosstodon.org/users/dellagustin/statuses/109794075204000680",
    "type": "Note",
    "summary": null,
    "inReplyTo": "https://blob.cat/objects/5af09451-bccb-4a63-82fd-9a32316cff88",
    "published": "2023-02-02T07:57:13Z",
    "url": "https://fosstodon.org/@dellagustin/109794075204000680",
    "attributedTo": "https://fosstodon.org/users/dellagustin",
    "to": [
        "https://www.w3.org/ns/activitystreams#Public"
    ],
    "cc": [
        "https://fosstodon.org/users/dellagustin/followers"
    ],
    "sensitive": true,
    "atomUri": "https://fosstodon.org/users/dellagustin/statuses/109794075204000680",
    "inReplyToAtomUri": "https://blob.cat/objects/5af09451-bccb-4a63-82fd-9a32316cff88",
    "conversation": "tag:podcastindex.social,2023-01-13:objectId=4874906:objectType=Conversation",
    "content": "",
    "contentMap": {
        "en": ""
    },
    "attachment": [
        {
            "type": "Document",
            "mediaType": "image/jpeg",
            "url": "https://cdn.fosstodon.org/media_attachments/files/109/794/074/904/068/648/original/98a8994f90dc97a6.jpeg",
            "name": null,
            "blurhash": "UHFrw??a4mkDxuxas-ae9Eog-=s:ITRPa|bI",
            "width": 1663,
            "height": 1247
        }
    ],
    "tag": [],
    "replies": {
        "id": "https://fosstodon.org/users/dellagustin/statuses/109794075204000680/replies",
        "type": "Collection",
        "first": {
            "type": "CollectionPage",
            "next": "https://fosstodon.org/users/dellagustin/statuses/109794075204000680/replies?only_other_accounts=true&page=true",
            "partOf": "https://fosstodon.org/users/dellagustin/statuses/109794075204000680/replies",
            "items": []
        }
    }
}

Related issues and commits

@johnspurlock-skymethod
Copy link
Contributor

🤦‍♂️

Sorry, you can tell the level of testing I did on that change - I'll take a look

@johnspurlock-skymethod
Copy link
Contributor

I think it's because that instance is returning null, instead of undefined or string.

This should fix it, but I'm going to deploy it to the livewire validator and throw a few test threads at it

5ce6b08

@johnspurlock-skymethod
Copy link
Contributor

Looks good on my side - published 0.1.11 with the fix

@dellagustin
Copy link
Author

dellagustin commented Feb 2, 2023

🤦‍♂️

Sorry, you can tell the level of testing I did on that change - I'll take a look

happens to the best of us 😄, I'll retest, thank you for the fix!

@dellagustin
Copy link
Author

Tested, it worked for me. Thanks again for the updates.

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