PreTeXtBook/pretext-cli

Pretext view - removed delay causes issues

Closed this issue · 3 comments

When issuing "pretext view" (at least) Firefox will not show the actual project but the previously one. A browser refresh brings back the actual project files.

It seems that the removed delay in starting the local webserver causes this issue because previously with the delay there was no such behaviour.

Similarly, we need a longer delay for Codespaces (maybe a couple extra seconds) - as of late the web server isn't beating the automatic browser opening.

I tried several things:

  • In the cli.py script I set the sleep time to 5 seconds and tried again
  • SECONDS = 5
    log.info(f"Opening browser for {target_name} at {url}")
    time.sleep(SECONDS)
    webbrowser.open(url)

The behaviour does not change. I still have to reload the page to get the actual project after the 5 seconds delay

  • Used the --no-launch parameter to test this setup. Still no luck. When I enter the URL at the given address I again have to do a reload to see the actual project.
  • Same behaviour when I use Google Chrome instead

Maybe this is a caching issue with browsers in general?

This might or might not be complete. Waiting for feedback from pretext-support