Labels are not applied to issues created by Utterances
See original GitHub issueI have integrated Utterances like this:
<script src="https://utteranc.es/client.js"
repo="thomaslevesque/blog"
issue-term="pathname"
label="post-comment"
theme="github-light"
crossorigin="anonymous"
async>
</script>
It works fine, except that the post-comment
label is not applied to issues. It worked the first time I tried it (see this issue – there isn’t actually a comment because I deleted it), but since then Utterances never applied the label.
Note: the only time it worked, I was the one commenting. Could this be because I’m the repo owner?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Label your utterances in Language Studio - Azure
Use the following steps to label your utterances: Go to your project page in Language Studio. From the left side menu, select Data...
Read more >utterances
utterances. utterances. A lightweight comments widget built on GitHub issues. Use GitHub issues for blog comments, wiki pages and more!
Read more >Unsupervised Multi-Topic Labeling for Spoken Utterances
limitation, a system must grasp the topics the user is talking about. Therefore, we apply unsupervised multi-topic labeling to spoken utterances.
Read more >NLU Not working for OOB and Custom Topics - ServiceNow
Hi, I am facing issue with NLU for my custom topics and OOB topics. I have created a NLU model With 2 intents...
Read more >Homework 3 Part 2 Utterance to Phoneme Mapping
In this homework you will again be working with speech data. We are going to be using ... However in this assignment, the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@phil-opp very good point! Maybe the label should be specified in utterances.json instead In fact, the same is true of other parameters, like
issue-term
.OK, I’m not sure I understand everything in the code, but I think I might be onto something…
The issue is created by @utterances-bot, which is authenticated with its own token, like this:
https://github.com/utterance/utterances-oauth/blob/d7d294461a01d902005a5c7b511eb23db07aa6d9/src/routes.ts#L199
However, to apply the label, utterances uses the commenter’s authorization header, like this:
https://github.com/utterance/utterances-oauth/blob/d7d294461a01d902005a5c7b511eb23db07aa6d9/src/routes.ts#L211
So, it uses the commenter’s identity to apply the label, which probably fails because that user doesn’t have permissions to apply the label. I suspect that the error is somehow swallowed by
fetchEvent.waitUntil
.Anyway, maybe the fix is as simple as using
'token ' + settings.bot_token
instead ofauthorization
, to apply the label under the identity of @utterances-bot?I’m not sure if that makes sense… I don’t know Typescript very well.