https://github.com/rktjmp/phx-pubsub-socket-bug
Bug repo
https://github.com/rktjmp/phx-pubsub-socket-bug
Last synced: 7 months ago
JSON representation
Bug repo
- Host: GitHub
- URL: https://github.com/rktjmp/phx-pubsub-socket-bug
- Owner: rktjmp
- Created: 2022-02-03T15:28:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-03T16:52:38.000Z (over 3 years ago)
- Last Synced: 2025-01-27T08:24:50.171Z (9 months ago)
- Language: Elixir
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StickyBug
## Outline
We have a standard LiveView app, and we want to show notifications.
We deliver notifications over a PubSub topic.
We have a standard LiveView setup, with one nested LiveView (`ListenLive`).
`ListenLive` subscribes to the topic on mount (once connected) and then handles
new notifications as they come.`Notify` (nested in ListenLive for this demo) provides a `.notify` function that
will broadcast a notification on the topic.`ListenLive` is `sticky` but that does not actually effect the observed behaviour.
## Bugs
There are two bugs observed, see http://localhost:4000/bug/alice for
reproduction instructions.1) A javascript exception "statics is undefined" in `comprehensionToBuffer`
2) ListenLive receives broadcasts, updates its socket assigns, but won't re-render those changes.
[ListenLive (& Notify)](https://github.com/rktjmp/phx-pubsub-socket-bug/blob/master/lib/sticky_bug_web/live/listen_live.ex): The "sticky nested liveview" that renders notifications.
[BugLive](https://github.com/rktjmp/phx-pubsub-socket-bug/blob/master/lib/sticky_bug_web/live/bug_live.ex): The bug triggering code in handle_params.
[OtherLive](https://github.com/rktjmp/phx-pubsub-socket-bug/blob/master/lib/sticky_bug_web/live/other_live.ex): just another navigable page.