Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix saga error should not result in unhandled exception #2421

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixes [#2435](https://github.com/microsoft/BotFramework-WebChat/issues/2435). Fix microphone button getting stuck on voice-triggered expecting input hint without a speech synthesis engine, by [@compulim](https://github.com/compulim) in PR [#2445](https://github.com/microsoft/BotFramework-WebChat/pull/2445)
- Fixes [#2472](https://github.com/microsoft/BotFramework-WebChat/issues/2472). Update samples to use repo's version of React, by [@corinagum](https://github.com/corinagum) in PR [#2478](https://github.com/microsoft/BotFramework-WebChat/pull/2478)
- Fixes [#2473](https://github.com/microsoft/BotFramework-WebChat/issues/2473). Fix samples 13 using wrong region for Speech Services credentials, by [@compulim](https://github.com/compulim) in PR [#2482](https://github.com/microsoft/BotFramework-WebChat/pull/2482)
- Fixes [#2420](https://github.com/microsoft/BotFramework-WebChat/issues/2420). Fix saga error should not result in an unhandled exception, by [@compulim](https://github.com/compulim) in PR [#2421](https://github.com/microsoft/BotFramework-WebChat/pull/2421)

### Added

Expand Down
72 changes: 37 additions & 35 deletions packages/core/src/reducers/connectivityStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,43 @@ import { SAGA_ERROR } from '../actions/sagaError';
const DEFAULT_STATE = 'uninitialized';

export default function connectivityStatus(state = DEFAULT_STATE, { type, meta }) {
switch (type) {
case CONNECT_PENDING:
case RECONNECT_PENDING:
if (state !== 'uninitialized') {
state = 'reconnecting';
}

break;

case CONNECT_FULFILLED:
state = 'connected';
break;

case RECONNECT_FULFILLED:
state = 'reconnected';
break;

case CONNECT_REJECTED:
state = 'error';
break;

case CONNECT_STILL_PENDING:
state = 'connectingslow';
break;

case DISCONNECT_FULFILLED:
state = meta.error ? 'error' : 'notconnected';
break;

case SAGA_ERROR:
state = 'sagaerror';
break;

default:
break;
if (state !== 'sagaerror') {
compulim marked this conversation as resolved.
Show resolved Hide resolved
switch (type) {
case CONNECT_PENDING:
case RECONNECT_PENDING:
if (state !== 'uninitialized') {
state = 'reconnecting';
}

break;

case CONNECT_FULFILLED:
state = 'connected';
break;

case RECONNECT_FULFILLED:
state = 'reconnected';
break;

case CONNECT_REJECTED:
state = 'error';
break;

case CONNECT_STILL_PENDING:
state = 'connectingslow';
break;

case DISCONNECT_FULFILLED:
state = meta && meta.error ? 'error' : 'notconnected';
break;

case SAGA_ERROR:
state = 'sagaerror';
break;

default:
break;
}
}

return state;
Expand Down