Skip to content

Commit

Permalink
Update @ws RouteSelectionExpression that did not match Sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Feb 1, 2024
1 parent ecefbb0 commit 7842ca1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions changelog.md
Expand Up @@ -10,6 +10,14 @@
- Added Node.js 20.x to test matrix
- Breaking change: removed support for Node.js 14.x (now EOL, and no longer available to created in AWS Lambda)


### Fixed

- Potentially breaking fix: resolved mismatch between `RouteSelectionExpression` in deployed Architect apps vs. locally in Sandbox
- The `RouteSelectionExpression` is now `$request.body.action`, meaning WebSocket code running locally (but not on AWS) should be updated from `ws.send(JSON.stringify({ message: 'custom-endpoint', ... }))` to `ws.send(JSON.stringify({ action: 'custom-endpoint', ... }))`
- This fixes #768; thanks @mawdesley + @MartinRamm!


---

## [8.5.2] 2023-08-22
Expand Down
2 changes: 1 addition & 1 deletion src/visitors/ws/index.js
Expand Up @@ -16,7 +16,7 @@ module.exports = function visitWebSockets (inventory, template) {
Properties: {
Name,
ProtocolType: 'WEBSOCKET',
RouteSelectionExpression: '$request.body.message'
RouteSelectionExpression: '$request.body.action'
}
}

Expand Down

0 comments on commit 7842ca1

Please sign in to comment.