Open ericswpark opened 8 months ago
I think this is because GitHub is not doing an exact string match on issues... you can try the query yourself
To see that it returns the /ko/ ones when searching with the non-ko URL.
I'm also thinking it is treating the / and - characters as whitespace... so it is really searching for any issues with the following strings
https ericswpark.com blog 2020 2020 10 11 porting samsungs galaxy note 3 neo
To fix, I would say it might work if the URL was condensed into a single string both when the 1st issue is posted and when searching.... so something like "ericswpark.comblog202020201011portingsamsungsgalaxynote3neo"
Or a hash of the URL? a MD5 hash of the non-ko post would be 40b39569eb54ed2e4e29175a9343914c and the ko one would be cd1d3eb3b0ff6da17ac4c0924bda8ab7
I think the OP should have some hash of the URL that utterances could compare against, to make sure that the correct thread is fetched.
Think I found the relevant part:
This function should check if the response returned from the GitHub API has a matching title:
Actually, seems like title matching is already done: https://github.com/utterance/utterances/blob/9e79bdaaa48c0b83d224c58f132db317785103cd/src/github.ts#L151 https://github.com/utterance/utterances/blob/9e79bdaaa48c0b83d224c58f132db317785103cd/src/github.ts#L156
So the only change needed is to not blindly return the first result when none of the titles match, and seems like there's already a PR open for that: #496
I have two blog sections on my website:
The first link is for the English version of my website, while the second one is for the Korean version. As the audience for these two blogs speak different languages, it makes sense to separate the comments section as well.
However, Utterances is mixing the two comment sections, even though I'm using the
url
mapping option. For example, see: https://ericswpark.com/blog/2020/2020-10-11-porting-samsungs-galaxy-note-3-neo/ Even though the blog is in the English version, it is pulling up the Korean comment section with the issue title of https://ericswpark.com/ko/blog/2020/2020-10-11-porting-samsungs-galaxy-note-3-neo/