Form update uses incorrect target on reconnect
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
Rechercherichtung
Start by creating the simplified reproducible project described in the issue, using Surface v0.6.1, LiveView v0.16.4, and the shown component hierarchy. Trace reconnect handling and the handle_event/3 target resolution while the tab is backgrounded; done means reconnecting no longer repeatedly calls MyLiveComponent.handle_event/3 instead of the LiveView handler.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I have a component hierarchy that looks something like this:
MyLiveView
-> MyLiveComponent
-> MyFormComponent
-> <Surface.Components.Form change={"update", target: :live_view} ... />
This works great on the golden path, handle_event/3 is called on the LiveView as expected.
However, if the tab has to reconnect to my app while the tab is in the background, such as in the following scenarios:
- Put the tab in the background (i.e. open some other tab as the active tab)
- Restart the server
or
- Put the tab in the background (i.e. open some other tab as the active tab)
- Close computer (goes to sleep)
- Open computer later
My app tab (which is not the active tab in Chrome) will reconnect and attempt to call handle_event on MyLiveComponent instead of on MyLiveView, over and over again, indefinitely.
The (redacted) error I see in my console is:
** (UndefinedFunctionError) function MyLiveComponent.handle_event/3 is undefined or private
If I then click on the tab and make it the active tab, it seems to do something slightly different and is able to re-establish the correct target and figure it out.
I wasn't sure if this was a dev-only issue, but I recently launched to the public and found that it indeed affects production as well, as AppSignal is showing 1,800 errors per hour, per user.
I'm going to work on making a simplified, reproducible project once I have a minute, but I'm not familiar with the internals of Surface or LiveView and wondered if anyone had any feedback on where I might start looking for the problem, or a workaround.
Surface: v0.6.1
LiveView: v0.16.4
Elixir: v1.12.2
Chrome: 96.0.4664.110
- Vorherrschende Sprache
- Elixir
- Sterne
- 2.1k
- Forks
- 146
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus surface-ui/surface
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
surface-ui/surface#634 · 1 Reaktion ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
surface-ui/surface#770 ·
-
Website is downOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
surface-ui/surface#768 · 4 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
surface-ui/surface#762 · 2 Kommentare · 1 Reaktion ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
surface-ui/surface#759 · 1 Reaktion ·
Alle Issues in surface-ui/surface
Ähnliche Issues
-
(FunctionClauseError) in DataToParams.transform_relationship/2` on scalar relationship linkageOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
beam-community/jsonapi#473 ·
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
ci-cd
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
carverauto/serviceradar#5648 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag