Unable to update library (project shared via project url)

Issue #534 open
Wenjie Wu created an issue

Sharing MicroBlocks projects via url is very popular among users, and people can embed it in teaching content or blog posts.

There are two styles of URLs:

They currently face a common problem: when the libraries is upgraded, it will corrupt the project. This is a serious problem, it will make many shared projects stop working.

for example, click the link,

https://microblocks.fun/run-pilot/microblocks.html#project=https://wwj718.github.io/post/img/test.ubp

A prompt will appear in the IDE:

Found a newer version of LED Display Do you want me to update the one in the project?

click "yes", project code will disappear

Download this file(https://wwj718.github.io/post/img/test.ubp) locally and manually drag it into the IDE(https://microblocks.fun/run-pilot/microblocks.html) , and everything will work fine.

Comments (10)

  1. John Maloney repo owner

    Is the test project this script:

    scriptImage32689.png

    For me, updating the project to use the new version of the LED Display library appears to work as expected -- although I did not actually run the script. What are the symptons that you are seeing?

  2. John Maloney repo owner

    Rather curiously, I'm seeing different behavior in the Chrome and Safari browsers. In Safari, the project loads and I see the script whether or now I choose to update the library. In Chrome, I do NOT see the script in either case. So this behavior may be somehow related to Chrome.

  3. John Maloney repo owner

    My Safari is 17.1, somewhat older. I think Safari and Chrome are both based on Webkit so some recent change may have broken something. It seems to be recognizing that the project uses the LED Display library, so it must be getting some of the data, but for me the script is missing when I open the project in Chrome but not from Safari or Firefox.

  4. John Maloney repo owner

    Does it open for you in other browsers (e.g. Firefox)?

    I'm on vacation through July 15 so I won't have time to dig into this in detail until I get back.

  5. John Maloney repo owner

    One possible explanation is that the downloaded project data is being corrupted or decoded incorrectly. To test that theory, one could might modify the IDE to write the downloaded file to the Javascript console line by line and look for anything strange.

  6. Wenjie Wu reporter

    It seems to be recognizing that the project uses the LED Display library, so it must be getting some of the data

    I agree with this inference.

    but for me the script is missing when I open the project in Chrome but not from Safari or Firefox.

    Does it open for you in other browsers (e.g. Firefox)?

    My situation is different: the script is missing when I open the project in Chrome (126.0.6478.115) and Safari(17.3.1) but not from Firefox (127.0.2).

  7. John Maloney repo owner

    That's consistent with the theory that a change to the WebKit browser codebase is making the script fail to appear in Chrome and Safari 17.3.1. We are seeing correct behavior (script appears) in Firefox and in my older version of Safari.

    Bottom line: This problem was introduced by a change in the WebKit browser code base, not by a change in the MicroBlocks code.

    My guess is the downloaded project file is being changed in some way that causes the "script" entry to not parse correctly. I'm traveling this week but will investigate further when I return next week.

  8. Log in to comment