-
Notifications
You must be signed in to change notification settings - Fork 21
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
Codespace/codechat issue with 2.3.5+ #677
Comments
As of today, new projects created with pretext-codespaces do not work with codechat preview. Temporary workaround is still to |
So I discovered during my faculty meeting demo of pretext Could I have reverted the 2.3.6 fix in 2.3.7??? |
Yeah, it also works fine in 2.3.6. I'm guessing there was a change in the static js files, since this uses a newer core commit. Infact, building with 2.3.8 and viewing with 2.3.6 does not work. Also, we need to figure out a way to put this in our tests. Not understanding what the issue actually is, I'm not sure how to test for it. |
I think the correct fix is to package these files in a JS bundler (esbuild is my favorite). Otherwise, we'll keep getting shut down by Microsoft's firewall, which thinks we're using CodeSpaces as a web server. @siefkenj and of course Brad have lots of experience doing this. Is there any interest from the core team (@rbeezer, etc.) for doing this? If so, this should be done with Runestone in mind, since we already bundle JS using Runestone. |
This isn't just a Codespaces thing for clarity, though that's the pain at hand today - we need to produce HTML that can be served even if the host rate limits the number of javascript files loaded. |
Could someone clarify for me exactly what the problem is. (or point me to the discussion on -dev if it is already there.). I'm having a hard time figuring out how build times and rate limits on javascript loads are related... |
Here is the -dev link: https://groups.google.com/g/pretext-dev/c/VABcbEle0R0 For what it's worth, I don't see the problem when using just a simple |
Thanks Oscar, I just found it myself. Are you seeing a status code of In looking at several pages from the sample book, built with 2.3.8 emacs only counts 22 css or js files that are loaded from Github pages only rate limit is on the overall bandwidth used during the course of a month. A simple github page loads more than 40 js files! |
Oscar, are you running the simple python based server in codespaces? Maybe someone should look at the network panel in the browser when using CodeChat to get a sense for how much requesting is going on in the background.... |
CodeChat adds just a few more files that are loaded at startup, then not reloaded. However, it doesn't cache files so that any edits to a page get revealed immediately. |
If a user is editing pretext and viewing the results in codechat they are not changing the javascript or css... So I'm not seeing the harm in caching the css/js files. Sorry if I'm still not understanding the problem well enough. I guess I should take some time and try to set up one of my books under codespaces so I can see the user experience. |
I'm wondering now if it is a permissions issue. Here is one of a bunch of errors I get from the console when a page finally loads:
Also a lot of:
Another odd thing: when I test using the pretext-cli codespace for development, it works just fine. It is only on a pretext project in its own codespace that has issues. Checking permissions of the output folders seems to show no difference though. Here is some output from the terminal:
|
My guess: the broken pipe occurs because CodeSpaces permanently closed the port due to exceeding rate limits, not because of permissions. |
Most of the time, the CSS/JS don't change, but if Pretext gets upgraded, it might. Perhaps we can cache these anyway and warn users they need to force a reload? Or do the CSS/JS files have some sort of version specifier to help with this? |
This:
Seems quite significant. Especially since the script tags to the Again, using the Network tab might give more clues as far as response codes from the server. |
In the just released 2.3.9, I found a workaround for now at least (but not for codechat): when the CLI notices that we are using codespaces, it will simply |
@oscarlevin The command |
I did some debug on CodeChat -- I only get this when the server doesn't respond to a request, so the client gets no/empty data and therefore sees an empty MIME time. When the server does respond, it sends the correct MIME type. |
I spent a fair amount of time debugging this weekend. I haven't tracked down the root case. Observations:
|
I filed bottlepy/bottle#1442, hoping the Bottle team can track this down. |
I tried switching back to Flask as a server, but that also failed. |
I assume this has something to do with how static files are now handled. But in a Codespace using PreTeXt-CLI 2.3.5 or 2.3.6, CodeChat builds are taking a long, sometimes random amount of time. Downgrading to 2.3.4 alleviates the issue. (EDIT: or maybe not - now I'm having trouble with 2.3.4.)
The text was updated successfully, but these errors were encountered: