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

Browser testing of new JupyterLite-based live shell sympy.org/en/shell.html #176

Open
ivanistheone opened this issue May 9, 2022 · 22 comments

Comments

@ivanistheone
Copy link
Contributor

We recently launched a new version of the SymPy Live shell on the website and need eveyone's help testing the shell works on various browsers and operating systems (in particular mobile browsers).

Context: this testing will help us iron out any issues before we move forward migrating https://live.sympy.org/ to use the JupyterLite-based shell.

Instructions:

  1. Using your mobile device, go to the URL: bit.ly/sympyjstest
    • click the first link to the shell and try entering some SymPy commands
    • click on one of the links under "evaluate commands" to test the backward compatibility of saved sessions
  2. Add a comment to this issue to indicate the results:
    • did it work or did it hang (code cells stuck showing [*])
    • if it worked, how long did it take to load?

Be sure to include information about the browser you used and the operating system version. If you see errors displayed, please take a screenshot and post image in your comment.

@ivanistheone
Copy link
Contributor Author

Edge on iOS WORKS

Edge on iOS works

A little slow (30 seconds) but overall works fine.

@ivanistheone
Copy link
Contributor Author

Safari, Opera, and Firefox on iOS doesn't work

iOS browser testing

Shell hangs [*] and sometimes errors are displayed (see jupyterlite/jupyterlite#632 and jupyterlite/jupyterlite#633).

Current guess is that issue is upstream with Pyodide, not something specific to JupyterLite, so we can hope it will be fixed eventually.

@ivanistheone
Copy link
Contributor Author

Device: iPhone 13 with latest iOS

I tried the online shell in both Safari and Chrome and saw the same error:

Safari on iPhone 13 fails Chrme on iPhone 13 fails

@ivanistheone
Copy link
Contributor Author

Chrome on recent Samsung Galaxy (Android) works:

Chrome on Samsung Galaxy works

though I noticed some weirdness about the Instructions font size.

@certik
Copy link
Member

certik commented May 11, 2022

  • Apple M1 Max laptop: I tested Firefox and Safari and both browsers work fine.
  • iPhone 10: Firefox and Safari: it seems to hang with the [*] prompt (it never loads).

@asmeurer
Copy link
Member

asmeurer commented May 11, 2022

I see this error in the console every time I load the page

GET https://www.sympy.org/live/api/contents/all.json 404

@ivanistheone
Copy link
Contributor Author

I see this error in the console every time I load the page
GET https://www.sympy.org/live/api/contents/all.json 404

That's OK. This is a lookup for pre-loaded notebooks that JupyterLab does on startup. Since we're using only the REPL and not the notebooks feature (we have no content), this occurs.

Maybe we could add a {} content to avoid generating this error, but it's definitely not on the critical path.

@jtpio
Copy link
Contributor

jtpio commented May 16, 2022

Maybe we could add a {} content to avoid generating this error, but it's definitely not on the critical path.

For reference this could indeed be done by adding some placeholder content to the deployment. For example by adding the following:

# populate placeholder content to avoid 404s errors in the dev tools console when fetching all.json
mkdir contents
cp README.md contents

Before https://github.com/sympy/live/blob/86b6acbe1ed5bc2ee10337345c3b97476c5c2dd0/.github/workflows/deploy.yml#L26

@ivanistheone
Copy link
Contributor Author

ivanistheone commented May 27, 2022

Update on the iOS problems.

Apparently all errors we saw were due to an upsteam issue in pyodide being broken WASM in iOS 5.4, but it that seems to be fixed now in latest iOS 5.5.

I encourage anyone with an iPad/iPhone to try out the links in: https://bit.ly/sympyjstest
EXPECTED: there should be no more errors

If you encounter an errors plz add comment to this thread.

@asmeurer
Copy link
Member

I still have issues where it won't load in the builtin browser of the Twitter app. It loads just fine in the safari app.

I also saw an issue with someone else's android phone where it was impossible to type something without autocorrect changing it. I believe what we were trying to type was something like primepi(1000).

@ivanistheone
Copy link
Contributor Author

Testing report from a friend (received by email).

I finally got around to testing this on a couple of Android devices. On an old Lenovo Android 4.4 device, it does not appear to load at all, but that's not too surprising given the age of both Android and the device. On the Pixel C, with a much newer Android version (at least 8), the examples all seem to run correctly, albeit naturally slower than on desktop.

Generally, though, while it works, it is really hard to know when it's working / ready in the beginning due to lack of feedback during delays. This is mostly during startup, and I did see the note about it, but even on a fast computer it takes so long that basically I'm left wondering if it's still starting up or if something has gone wrong.

@asmeurer
Copy link
Member

I agree the feedback could be better (IMHO even the notebook itself has this problem). Presumably this is something that should be improved in the upstream jupyterlite.

@jtpio
Copy link
Contributor

jtpio commented Jul 27, 2022

Android 4.4 is indeed extremely old and not supported anymore by most mobile applications anyway.

Improved visual feedback while the shell is loading is tracked in jupyterlite/jupyterlite#619.

@asmeurer
Copy link
Member

asmeurer commented Oct 3, 2022

What needs to be done to complete the SymPy Live migration? The docs no longer have the extension at all, so I believe all that needs to be done is to redirect live.sympy.org to https://www.sympy.org/en/shell.html, and to shut down the app engine service.

@ivanistheone
Copy link
Contributor Author

Sorry for being so slow with this.

I just finished dev steps for PHASE3, so if anyone wants to review and merge sympy/live#13 then we'll be ready to change the DNS for live.sympy.org (PHASE4).

@ivanistheone
Copy link
Contributor Author

Okay merged PR#13 and it works: https://www.sympy.org/live/ (this will be the future live.sympy.org)

I'm going to wait to hear from @jtpio about these questions sympy/live#7 (comment) about the customization I did on the index.html before proceed with DNS switchover.

@ivanistheone
Copy link
Contributor Author

@certik Would you have time in coming days to do the DNS changes?

I am available tomorrow (Wednesda) and Thursday for "live debugging" in case we need to change anything in the repo at the same time.

@certik
Copy link
Member

certik commented Oct 18, 2022

Yes, let's do that.

@asmeurer
Copy link
Member

asmeurer commented Nov 1, 2022

Looks like the DNS change has happened, and live.sympy.org now points to the webassembly version. Can we disable the billing in the App Engine version now? Also, what remains to be done? Should we archive the sympy-live repository?

@ivanistheone
Copy link
Contributor Author

ivanistheone commented Nov 2, 2022

Yes we "launched" the wasm version (served from github pages) with Certik last week, so we can shut down the GAE project (nothing points to it anymore). I tagged you with that task in the google doc.

I had a few more cleanup tasks planned in PHASE 5 and I hope to get to them later this week (finishing up some work on a deadline today/tomorrow).

Also, I was thinking of posting a twitter thread with examples of various useful things you can do with the live shell (with screenshots and links). It would be great if the SymPy account can re-tweet. I suck at marketing, but I think we need to promote the live shell more since it's such a good tool for learning/teaching.

Let me know if any objections if I post form my personal account or if y'all have suggestions for people we can tag in the tweets to attract more attention.

@asmeurer
Copy link
Member

asmeurer commented Nov 2, 2022

Yes we "launched" the wasm version (served from github pages) with Certik last week, so we can shut down the GAE project (nothing points to it anymore). I tagged you with that task in the google doc.

I have disabled the billing for SymPy Live in the App Engine.

Also, I was thinking of posting a twitter thread with examples of various useful things you can do with the live shell (with screenshots and links). It would be great if the SymPy account can re-tweet. Lol... I suck at marketing, but I think we need to promote the live shell more since it's such a good tool for learning/teaching.

I can also just post the thread directly from the SymPy account if you'd like. Either way, let me know (I control the SymPy Twitter account).

@ivanistheone
Copy link
Contributor Author

Okay cool. I'll work ont he thread and adding preparing the evaluate=? URLs for each example and let you know when it's ready. I guess it makes more sense to post from the official SymPy account (since I don't have much followers).

Here is the code I wrote last week that takes a string of commands (separated by blank lines) and turns them into a evaluate query sting

from urllib.parse import quote

BASE_URL = "https://live.sympy.org/"
SAFE_CHARS = "-_.!~*'()"  # according to `encodeURIComponent` in JS

def hist_to_qs(codein):
    codein = codein.strip()
    cells = codein.split("\n\n")
    cellouts = []
    for cell in cells:
        lines = cell.split("\n")
        cellout = ""
        for line in lines:
            cellout += line + "\n"
        cellouts.append(cellout)
    codeout = "#--\n".join(cellouts)
    return "evaluate=" + quote(codeout, safe=SAFE_CHARS)

See this notebook for usage examples: https://github.com/minireference/noBSstatsnotebooks/blob/main/notebooks/explorations/SymPy_Live_evaluate_URL_encoder.ipynb

It would be cool to package this funtion as some kind of jupyter notebook plugin to make it easy to "share" sympy commands, but for now just use manually.

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