kentbull

kentbull

Real Time Phoenix Errata P47: missing {} on channel creation causes blocking error

As of 2020-11-25 The syntax of channel.push(...) should be updated to include a second parameter.
As written the book states on page 47:

channel.push("ping")
    .receive(...)

This causes an error that precedes and prevents joining the channel in addition to preventing the reception of any messages back from the server:

A slight modification allows success:

channel.push("ping", {})
    .receive(...)

This error is likely due to a contract change in the Phoenix channel library.

Marked As Solved

sb8244

sb8244

Author of From Ruby to Elixir and Real-Time Phoenix

Hello,

Thanks for this report. You are correct. It looks like a change was introduced that assumes payload is an object, although the book uses it as undefined for that example.

I’m going to see if it’s intended that payload cannot be undefined.

Best,
Steve

Also Liked

sb8244

sb8244

Author of From Ruby to Elixir and Real-Time Phoenix

Hi @kentbull. I submitted a PR to Phoenix that was accepted. This should stop being an issue when the next patch of Phoenix 1.5 is released. When I first checked this bug out, I missed that the documentation still showed channel.push("event") as valid syntax.

kentbull

kentbull

That’s cool, I’m glad we caught it. Great book by the way, just finished Part 1 and am working on Part 2.

Popular Pragmatic Bookshelf topics Top

mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
conradwt
First, the code resources: Page 237: rumbl_umbrella/apps/rumbl/mix.exs Note: That this file is missing. Page 238: rumbl_umbrella/app...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
New

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
New
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
New