Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live reload doesn't refresh speaker notes in speaker view #2822

Closed
eliasp opened this issue Oct 25, 2020 · 4 comments
Closed

Live reload doesn't refresh speaker notes in speaker view #2822

eliasp opened this issue Oct 25, 2020 · 4 comments

Comments

@eliasp
Copy link

eliasp commented Oct 25, 2020

For editing/previewing my slides, I run npm start to make use of the live reload feature, to see changes on the fly.

While this works just fine for the slide content, it doesn't refresh the notes in the "Speaker View", although the slide previews in the "Speaker View" get refreshed just fine.
This happens for plain HTML notes, as well as for Markdown notes.

I can reproduce this issue in

  • Mozilla Firefox 82.0/Win10 1909
  • Google Chrome 86.0.4240.111/Win10 1909

Using reveal.js 0582f57 on Ubuntu 18.04 (NodeJS 12.18.4 provided through a Nix Shell environment)

Configuration:

Reveal.initialize({
    hash: true,
    plugins: [ RevealMarkdown, RevealNotes ],
    totalTime: 2100,
});

The output of gulp contains nothing unexpected:

[nix-shell:~/code-repositories/personal/eprobst/saltstack-a-history-of-systems]$ npm start

> reveal.js@4.1.0 start /home/eprobst/code-repositories/personal/eprobst/saltstack-a-history-of-systems
> gulp serve

[16:55:13] Using gulpfile ~/code-repositories/personal/eprobst/saltstack-a-history-of-systems/gulpfile.js
[16:55:13] Starting 'serve'...
[16:55:13] Starting server...
[16:55:13] Server started http://0.0.0.0:8000
[16:55:13] LiveReload started on port 35729
[16:55:13] Running server
[16:55:39] Starting 'reload'...
[16:55:40] Finished 'reload' after 82 ms
[16:55:46] Starting 'reload'...
[16:55:46] Finished 'reload' after 8.41 ms
[16:56:26] Starting 'reload'...
[16:56:26] Finished 'reload' after 16 ms
[16:56:30] Starting 'reload'...
[16:56:30] Finished 'reload' after 2.97 ms
@mikestopcontinues
Copy link

Same problem, using Vite to build/serve. After reload, not only do the notes not update, but the current notes stick. Only exiting and re-entering presenter modes shows the updates.

@dabrahams
Copy link
Contributor

I'm having the same problem as @mikestopcontinues when running the presentation through Jekyll serve. This seems like something that oughta be easy to fix, but I'm at a loss.

@hakimel
Copy link
Owner

hakimel commented Feb 10, 2022

This has been fixed in master 🥳 Please give it a try when you get a chance.

The core issue here has always been the main window losing its reference to the speaker window after reloading. I've tried to fix this a few times before but finally found a solution today.

The speaker window now continuously sends a heartbeat via postMessage every 1s. The main window listens for these heartbeats and if it ever receives one from a notes window it has no reference to, it will reconnect that window. That means no matter why the main window reloads it will always reconnect to the open speaker view.

@hakimel hakimel closed this as completed Feb 10, 2022
@mikestopcontinues
Copy link

Thanks @hakimel. You're solution actually also just solved a long-standing bug in my own app's iframe communication. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants