question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Labels are not applied to issues created by Utterances

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thomaslevesquecommented, May 14, 2020

@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.

1reaction
thomaslevesquecommented, May 13, 2020

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 of authorization, 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found