umputun / remark42

comment engine
https://remark42.com
MIT License
4.81k stars 374 forks source link

Commento import results in a tree which refuses to be represented #1696

Closed RealOrangeOne closed 9 months ago

RealOrangeOne commented 9 months ago

I've imported following the commento docs, and after some manual URL updating (I'll open a PR soon), the content imports. However, the tree it creates doesn't appear to be valid, and can't be represented by the API:

{
    "comments": [],
    "info": {
        "url": "https://example.com/page/",
        "count": 5,
        "first_time": "2023-11-01T22:24:04.639965Z",
        "last_time": "2023-11-01T22:24:04.639965Z"
    }
}

Notably, if I change &format=tree to &format=plain, all comments are shown as expected, and a comment's pid matches another id, with root comments having a pid of "root". Example:

        {
            "id": "6d3bb64ff73b5f9d6a959212ffde472a51abf8bdefaa5ed843659796bceef9de",
            "pid": "46baf36433830a4e8bda1de56290cf5fd74c08bfa844fee4ec1744985dc77010",
            "text": "other comment text",
            "user": {
                "name": "xxxxxxxxxxx",
                "id": "commento_xxxxxx",
                "picture": "undefined",
                "ip": "xxxxxxx",
                "admin": false
            },
            "locator": {
                "site": "mysite",
                "url": "https://example.com/mypage"
            },
            "score": 0,
            "vote": 0,
            "time": "2023-11-01T22:23:47.112062Z",
            "imported": true,
            "title": "page title"
        },
        {
            "id": "46baf36433830a4e8bda1de56290cf5fd74c08bfa844fee4ec1744985dc77010",
            "pid": "root",
            "text": "Comment text",
            "user": {
                "name": "Name 1",
                "id": "commento_xxxxxxxxxx",
                "picture": "xxxxxxx",
                "ip": "xxxxxxxxxxxxx",
                "admin": false
            },
            "locator": {
                "site": "mysite",
                "url": "https://example.com/mypage"
            },
            "score": 0,
            "vote": 0,
            "time": "2023-10-31T11:03:25.403282Z",
            "imported": true,
            "title": "Page title"
        },

The content is clearly there, as the count value is definitely correct - however it seems there's an issue when representing it as a tree

paskal commented 9 months ago

Could you please attach the export of the comments which can be used to reproduce the issue? You could redact all confidential information from it.

RealOrangeOne commented 9 months ago

Of course: remark-1696.json

Oh, and version remark42 v1.12.1-1f2500f-20230821T11:59:46

Redacted and not entirely representative of a usual export, but importing this into remark causes the issue. Imported with remark42 import -p commento -f ./var/data.json -s mysite.