-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Do not override internal ref when watching view
What changed? ============ Currently, when we set a timeout for the original view we were watching (meaning we call `watch_view` with the same view that we pass to `start_link`), we override the `live_view_ref`. That can cause issues since we use the `refs` to identify views when a process id DOWN. This commit fixes that by ensuring we don't monitor a LiveView that we're already monitoring, and that we don't override the internal `live_view_ref`. The test peeks into the GenServer's state with `:sys` commands -- not the prettiest thing. But it didn't quit seem enough to warrant us having a `Watcher.view_info/1` function that fetched the info for that view. So, it seems okay for now.
- Loading branch information
Showing
2 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters