Skip to content

Commit

Permalink
Merge pull request #159 from dblock/fix-157
Browse files Browse the repository at this point in the history
Fix #157: SessionEndedRequest hangs without a defined sessionEndedFunc.
  • Loading branch information
dblock committed Feb 5, 2017
2 parents 0c3aedb + fc46aaa commit c0263f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [#119](https://github.com/alexa-js/alexa-app/pull/119): Moved to the [alexa-js organization](https://github.com/alexa-js) - [@dblock](https://github.com/dblock).
* [#118](https://github.com/matt-kruse/alexa-app/pull/118), [#117](https://github.com/matt-kruse/alexa-app/issues/117): Prevent updating session attributes directly - [@ajcrites](https://github.com/ajcrites).
* [#133](https://github.com/matt-kruse/alexa-app/pull/133), [#71](https://github.com/matt-kruse/alexa-app/issues/71): Support asynchronous patterns in request handlers - [@ajcrites](https://github.com/ajcrites).
* [#159](https://github.com/alexa-js/alexa-app/pull/159), [#157](https://github.com/alexa-js/alexa-app/issues/157): Fixed `SessionEndedRequest` hangs without a defined `sessionEndedFunc` - [@dblock](https://github.com/dblock).
* Your contribution here.

### 2.4.0 (January 5, 2017)
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ alexa.app = function(name) {
} else if (false !== sessionEndedResult) {
callbackHandler();
}
} else {
response.send();
}
} else if (request.isAudioPlayer()) {
var event = requestType.slice(12);
Expand Down
13 changes: 13 additions & 0 deletions test/test_alexa_app_session_ended_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ describe("Alexa", function() {
version: "1.0"
});
});

it("returns a response without a defined sessionEnded function", function() {
var subject = testApp.request(mockRequest);

return expect(subject).to.eventually.become({
response: {
directives: [],
shouldEndSession: true
},
sessionAttributes: {},
version: "1.0"
});
});
});
});
});
Expand Down

0 comments on commit c0263f2

Please sign in to comment.