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

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

Closed
RealOrangeOne opened this issue Nov 6, 2023 · 2 comments · Fixed by #1701
Closed

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

RealOrangeOne opened this issue Nov 6, 2023 · 2 comments · Fixed by #1701

Comments

@RealOrangeOne
Copy link

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
Copy link
Collaborator

paskal commented Nov 6, 2023

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.

@paskal paskal added the backend label Nov 6, 2023
@RealOrangeOne
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants