Skip to content

Opening and adding to/removing from collections sometimes crashes editor #1418

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

Closed
garystil opened this issue May 5, 2020 · 6 comments · Fixed by #1787
Closed

Opening and adding to/removing from collections sometimes crashes editor #1418

garystil opened this issue May 5, 2020 · 6 comments · Fixed by #1787

Comments

@garystil
Copy link

garystil commented May 5, 2020

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: Chrome Version 81.0.
  • Operating System: MacOSX 10.15.4
  • Steps to reproduce this bug:

A sketch that included an "*" (asterisk) in its name could be saved and played on the p5.js-web-editor. However, my attempt to add it to a collection resulted in a total white screen rather than the expected list of collections. After renaming the sketch w/o an asterisk, I was able to add it to a collection.

Since then, I'm occasionally met with the same white screen when attempting to add a sketch to a collection, even though the sketch name has no special characters in its name. As above, the white screen is completely blank. Its web address ends with "add-to-collection" leading me to think that the issue may be more than my original use of a special character.

@welcome
Copy link

welcome bot commented May 5, 2020

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@garystil garystil changed the title Asterisk-containing p5 Sketch Name can not be added to a Collection Problem with p5 Collections May 5, 2020
@catarak
Copy link
Member

catarak commented May 6, 2020

Oh no! The white screen indicates that the web editor is crashing, so that's not great. I just tried creating a new sketch with an asterisk in the name, and I wasn't able to get the web editor to crash or see any errors in the console, so it must be that something else is happening.

If you figure out a way to consistently make it crash, let me know! Otherwise I'll keep playing around.

@garystil
Copy link
Author

garystil commented May 7, 2020

As described, I had problems opening Collections that contained a sketch with an asterisk in its name. Clicking on File/Add to Collections crashed the editor as did clicking File/Open/Collections. I resolved this by deleting these Collections, creating new ones, and re-adding my sketches that did not contain an asterisk in their name.

As you advised, I tried to recreate the process with a new test collection and a test sketch containing an asterisk in its name. This time, there were no problems and the editor continued to function. Perhaps there was another cause of the crash (i.e. my storage space was approaching its limit?) but now everything is running fine. Oh yes!

Thanks for your time and consideration.

@catarak
Copy link
Member

catarak commented May 7, 2020

Thanks for trying to reproduce again! I'll leave this open for now in case someone else runs into a similar issue.

@catarak catarak changed the title Problem with p5 Collections Opening and adding to/removing from collections sometimes crashes editor May 7, 2020
@sagar-joshi
Copy link
Contributor

I also noticed that the editor crashes on clicking the AddSketch button in CollectionList.
What I figured out is :
A sketch may be present in many collections, but the problem occurs when the sketch is deleted from the sketch list but it is still present in different collections it was added to. So if we click on add sketch in those collections which have deleted sketches, the editor crashes while trying to access this.collection.items[x].project.

@sagar-joshi
Copy link
Contributor

After reading #1465 it looks like the fix is to check for item.isDeleted before accessing item.project in AddToCollectionSketchList
But this will only partly fix the issue because I was not able to reproduce the asterisk part.

Since then, I'm occasionally met with the same white screen when attempting to add a sketch to a collection, even though the sketch name has no special characters in its name.

Maybe the collection had deleted sketches in it which may have caused the crash (I was able to reproduce this part: adding a sketch to a collection which has deleted sketches in it causes a crash) Also it only crashes if we click Add sketch from the dropdown in CollectionList or if we click on the add sketch button from CollectionView

As described, I had problems opening Collections that contained a sketch with an asterisk in its name. Clicking on File/Add to Collections crashed the editor as did clicking File/Open/Collections.

I was not able to reproduce this part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants