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.

Can't open new tab with same endpoint URL by clicking the endpoint

See original GitHub issue

Version

4.4.1

Describe the bug

I have a bot file that I want to use for any local bot running on port 3978:

{
    "name": "3978",
    "description": "",
    "services": [
        {
            "type": "endpoint",
            "appId": "",
            "appPassword": "",
            "endpoint": "http://localhost:3978/api/messages",
            "id": "1",
            "name": "Unauthenticated"
        },
        {
            "type": "endpoint",
            "appId": "<GUID>",
            "appPassword": "<password>",
            "endpoint": "http://localhost:3978/api/messages",
            "id": "2",
            "name": "GitHubProfileBot"
        }
    ],
    "padlock": "",
    "version": "2.0",
    "path": "C:\\Dev\\3978.bot",
    "overrides": null
}

This shows up just fine in the bot explorer panel, and I can open up both endpoints simultaneously by clicking “Open in Emulator” in the context menu:

image

However, you are supposed to be able to open an endpoint by just clicking on it in the endpoint list. This doesn’t work if the endpoint has the same URL as an endpoint that’s already open. It seems like the behavior for clicking an endpoint from the list involves checking the endpoint URL to see if it matches any of the open tabs, and then switching to that tab if one is found. It doesn’t realize that the tab it’s switching to is not the same endpoint as the one I clicked.

To Reproduce

Steps to reproduce the behavior:

  1. Give two endpoints the same URL in a bot file
  2. Open the bot file in the Emulator
  3. With one endpoint already open, click the other endpoint in the endpoint list in the bot explorer panel
  4. Notice that the endpoint isn’t opened in a new tab

Expected behavior

The Emulator should recognize an endpoint by its ID (or perhaps the combination of all its properties) instead of its URL, and it should open an endpoint when you click on it even if another endpoint with the same URL is already open. While it may seem like this isn’t useful because you can’t run multiple bots on the same port, the Emulator does allow you to open multiple tabs with the same URL through the context menu, and that indicates that this bug is not by design.

[bug]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
justinwilabycommented, Jun 13, 2019

I can confirm that 2 endpoints within the same botfile with the same endpoint value will repro this.

This issue is a bot more complex and warrants discussion. The schema for the IConnectedService shows the id field as optional and no enforcement is made to ensure unique ids for services within a botfile. This fact lead the Emulator to register endpoints via the endpoint field which works for deployed bots but breaks for local bots given @v-kydela 's use case.

The question is then: “how do we guarantee a unique identifier for services within a botfile?”

  1. A naive approach may be to simply concat all field values within an endpoint and hope they do not conflict.
  2. The idiomatic approach would be to enforce the id field as required, read only and unique. Then validate this on all botfiles being opened in the Emulator. This affords us to register the endpoints by id instead of by theendpoint field since we can now rely on the ids being unique.

I am for solving #990 since it would address the side-effects of not being able to rely on unique ids.

1reaction
tonyanzianocommented, Jul 8, 2019

During standup last week, we decided that the root cause of the issue should be fixed, which is that the bot file – msbot – needs to generate a stable, unique id for endpoint services so that they can be reliably differentiated between by the Emulator.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open a URL in a new tab (and not a new window)
To open a new tab and stay on the same location, you can open the current page in the new tab ...
Read more >
Solved: How do I create a link that opens a new tab?
Solved: I want to have a link that opens to a new tab so that students can easily ... You can no longer...
Read more >
Service Desk KB articles open in a New tab. Feature or Bug?
This is intended behaviour, we always open in a new tab when a user clicks on a link in a KB article when...
Read more >
Can't open new tab in Postman - Just getting started
http://www.giphy.com/gifs/lTSxyCIxXvzg77Vufc I'm not able to open a new tab in Postman. I've clicked the + button and have tried Cmd + T.
Read more >
Google Chrome Privacy Whitepaper
Omnibox; Network predictions; Search locale; New Tab page ... you do not have any cookies from google.com, this request will not create any....
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