microsoft / microsoft/BotFramework-WebChat

Discussion: Who should call directLine.connect() and directLine.disconnect()

Open
#2,750 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

backlog feature-request
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

This will affect minimizability (DOM unmountability), thus, it plays a role in IC3 work.

Feature Request

Today, we call directLine.connect() when the React component is up. Technically, <Composer> will call useEffect to dispatch a connect action to saga. And call dispatch a disconnect when <Composer> is being unmounted.

Problems

Minimizable scenario

This affect minimizable scenario. In minimizable scenario, we want the Web Chat UI to be complete/almost gone from DOM tree to save resources. While the DOM component is gone, we want to maintain the connection.

Should core owns the connection, or component?

Today, <Composer> owns the connection. Should it be createStore to own it?

Proposals

Please list your proposals below.

A new option for the ownership of DirectLine connection

If the ownership is set to outside of Web Chat, Web Chat will not call connect/disconnect and would assume it is connected.

[Enhancement]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at 's useEffect and the saga actions that call directLine.connect() and directLine.disconnect(); compare that flow with the createStore ownership proposal. The issue does not define a chosen design or tests, so done requires an agreed connection-ownership proposal that preserves the connection during minimization.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.