sagemath / sagecell

The Sage Cell Server---providing a way to embed Sage computations into any web page.
Other
201 stars 70 forks source link

makeSagecell fails to return cellInfo object #555

Closed rayellis4 closed 2 years ago

rayellis4 commented 2 years ago

The makeSagecell call in the following snippet returns "undefined" and completes asynchronously:

siefkenj commented 2 years ago

Can you let me know what you're using cellInfo for? Making the cell is fundamentally asynchronous (the old code was asynchronous too, but in a very awkward way, so I'm guessing your use case either ran the makeSagecell code later in the page load or it didn't use all the info in cellInfo...)

rayellis4 commented 2 years ago

Whatever changes that have been made since I posted (1500 lines or so of new embedded_sagecell.js!!) seem to have fixed the problem, so this all might be moot. But, to answer to you: The cellInfo was used as an argument to deleteSagecell later in the program, which couldn't occur programmatically until the callback function executed. The cell was deleted when the user finished with example at hand. The cell is created in an iFrame, btw, to work around the jquery version problem. You can see the page on github. It's just a web page, no backend, and it should load reasonably quickly even on your first visit. Here's an example. About halfway down the page is a section entitled "Computed Properties", and each of the subsections (e.g., Abelian group, Class equation) has a "Compute this in GAP" button that demonstrates the GAP computation using sagecell. The first execution upon visiting the page works properly, but subsequent runs (used to) fail because the deleteSagecell call had an undefined cellInfo argument. Thanks for fixing this so quickly, I'll bet you have bigger projects to work on than a minor bug. And thanks for sharing sagecell!

-- Ray

novoselt commented 2 years ago

Ray - the issue was fixed in #556 and was not a drastic change. A "quick fix" was reverting to an older version of JavaScript, that differed quite a bit from the current state. The changes, however, should not break existing pages, so you have reported a valid bug. Please check that it is fixed now - as far as I can see with a test case and link that you have provided, it is indeed.

rayellis4 commented 2 years ago

Andrey --

Yes, it is fixed. Thank you!

-- Ray

On Sun, Mar 6, 2022 at 8:04 PM Andrey Novoseltsev @.***> wrote:

Ray - the issue was fixed in #556 https://github.com/sagemath/sagecell/pull/556 and was not a drastic change. A "quick fix" was reverting to an older version of JavaScript, that differed quite a bit from the current state. The changes, however, should not break existing pages, so you have reported a valid bug. Please check that it is fixed now - as far as I can see with a test case and link that you have provided, it is indeed.

— Reply to this email directly, view it on GitHub https://github.com/sagemath/sagecell/issues/555#issuecomment-1060114800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKE4RFOZYRFCTZGYSKA3RFDU6VP25ANCNFSM5P6GKR2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>