Block Deletion Upon Project Opening

Use this template to make awesome bug reports:

Your username: Swim Girl Studios

What kind of device are you using?: iPad Air 4th gen, iOS 15.1

1 sentence description of the problem:
I exited my project and reentered it and one of my Create a clone blocks was deleted

Steps that the Hopscotch team can take to reproduce my problem every time:
I have been unable to reproduce this in other projects, but it happens every time I close and reopen one of my drafts. It is also deleted whenevery hopscotch crashes.

I expected this to happen:
The block to be kept between opening and closing the draft.

But instead this happened:
The block was deleted each time the draft was opened.

Here’s a sweet screenshot:

For reference the block create a clone is deleted within this code:

When game starts {
    repeat times 5 {
        create a clone              <-----
    }
    set variable to 0

I couldn’t find a similar bug report when I looked, but if someone else sees one, let me know :)


Hopscotch Team note — reproducible steps from a new project here:

17 Likes

I also saw it happened with check if else containers as well (including everything within). Consistently too. It is so annoying…

5 Likes

Hmm strange. I tested this on a new draft and inserted a bunch of code inside a repeat times 1 container, then exited the draft while the play button was still shaking. Every single block in the container was deleted, including the container itself. When I did it a second time, it didn’t delete the code within. So I’m guessing it happens randomly, or every time the app crashes.

Device Details:
2021 M1 12.9" iPad Pro (iPad13,8)
Software Version: iPadOS 15.2
Hopscotch Version: 3.48.2
Player Version: 1.5.20

Of course, now it doesn’t delete on me anymore…

5 Likes

I’m having this problem too, with a custom block.

7 Likes

This is now happening in 2 objects in this project with the create a clone block in a repeat loop

4 Likes

Yeah that seems pretty odd. Can I ask permission to check the draft just so that I can see what’s going on?

1 Like

Just to check, if anyone who experienced this issue can remember —

When the block was being deleted, was it among the most recently added blocks? Or does it also happen with blocks that have already been present in the project for a while?

1 Like

ahh sorry for the late reply!

it was always a block that had been present for a while. It ended up happening with the same 2 blocks. They would always delete every time I would exit and reenter the project or app.

yeah, for sure! It was my latest project, Burger Joint. It uses seeds, so I’m not sure if you’ll be able to see the code.
I do know my sister had the same bug (@Manis do u still have that draft with the deleting block?)
Hers was with a custom block and mine was with 2 create a clone blocks that were in different objects.

2 Likes

No worries at all, thanks a lot for the information — it helps to clarify things.

Sorry for the extra questions but I’d appreciate if you have time to go through them, to try and dig and see what’s going on with this issue. (No rush, just whenever you can get to them, if you are alright with doing that.)

Yeah in that context, because they got deleted, I’m guessing you would have been adding them back into the project again each time. Were those particular blocks among the most recently added blocks also, because you were adding them back into the project again?

And when you re-added them, were there any other blocks added in other parts of the code that were lost?

(I’m trying to work out if it might be related to some recent changes not saving in the project, or if it’s something else like a particular sequence of blocks that is consistently deleting)

Thanks a lot, yeah I have access to projects in admin but I guess it’s a bit hard to exit and re-enter projects from there. Is it the grill object that was having the issue? (If so, is it still happening and which rule is it?)

If it’s happening with a bug in your sister’s project, could I ask permission to check it in admin as well? Though it would be easier if the project could be published so that I can save it as a draft to see (Maybe everything else in the project could be deleted except the object that is having the issue)

1 Like

I guess you could say that. When I would reopen the project I’d have to add them back in every time. I’d probably work on the project for an hour or so (while I was working, things would be fine) and then go out of it. When I would come back, those specific blocks would be gone. (does that answer your question?)

Nope

Yes, the grill was having the issue, as well as the toppings.
In the grill:

When game starts {
    repeat times 6 {
        create a clone                   <-------
    }
}

In the toppings:

When game starts {
    repeat times 8 {
        create a clone                   <-------
    }
}

It actually appears to still be doing it to me!! Hopefully it isn’t like this for other people! When I play the project and tap on the ‘build’ button at the top, none of the toppings are appearing on the left hand side. This is new for me in the published project. Is it this way for you? The grill is working, but the toppings don’t appear because they are missing the ‘create a clone’ block.

yeah, I’ll ask her to publish it for you.

2 Likes

Yep that makes sense, thanks a lot^^

Yeah that seems pretty odd.

It’s a bit hard for me to figure out how to test this, so I’ll bring it up with the team and we’ll look into it.

1 Like

By any chance did you copy and paste that repeat loop? I think that could be causing the problem.

2 Likes

I was able to download the project to Drafts now to start testing it

And yes unfortunately this was what happens for me when I play the published project too — none of the toppings appear :(

I did see the Create a Clone block missing in the Toppings code in that rule.

Edit: ok I can confirm that the block keeps getting deleted when I exit the project and re-open it — it is really strange. I’ll share the steps with the team with this project.

@SwimGirlStudios A temporary workaround that seems to work is to delete the “When game starts” rule, and then re-add the Repeat 8, Create a Clone block. Then it doesn’t delete when I exit the project and re-open it.

1 Like

ahh! I just went in and fixed that!!
its not a super fun game if you can’t actually play it /j
(@Yuanyuan - when you come back online could you take it out of the filter?)

hmm interesting… I wonder if maybe I copied and pasted the rule when I made it, like @/Awesome_E suggested (although idk why I would have since it’s just like 2 blocks haha but sometimes I’m lazy when I’m coding /j)

edit: it is possible that I duplicated the object though…

1 Like

I also found that when I add other blocks to that Repeat container (e.g. Move Forward, flip), it also deletes them when I exit and re-open the project. Same when I add multiple blocks.

That’s interesting and really helpful to know, to try and reproduce the issue^^

I can approve it from the filter for you too — I’ll do that now.

For the Repeat container that kept deleting the code, this was the JSON for it:

{
      "createdAt": 662182956.226994,
      "blocks": [
        {
          "type": 120,
          "parameters": [
            {
              "defaultValue": "5",
              "value": "8",
              "key": "times",
              "type": 57
            }
          ],
          "controlScript": {
            "abilityID": ""
          },
          "block_class": "control",
          "description": "Repeat"
        }
      ],
      "abilityID": "C0954847-7B6E-4D6B-8B6B-B42E0DDA4D6B-673-00000062038315DD"
    },

The controlScript details what code goes inside the Repeat container, and the abilityID for that is empty. So I think whatever code was being put in the editor, it wouldn’t be saved because the abilityID is empty.

(The abilityID would link to another list of blocks.) But I’m not sure how the empty abilityID may have been created in the first place.

It might be related to duplication or pasting, like in this other topic too Code Randomly disappearing when adding it. We’d need those steps to make the problem happen consistently, to be able to fix it.

So far I’ve been testing duplicating containers and objects, and editing the code inside but no luck in making the problem happen.

4 Likes

i have two projects having this issue too - both Copy of The Unstable Greenhouse (latest player) and The Unstable Greenhouse (not the latest player). Hopscotch username is as always Tri-Angle Studios.

it never saves the Wait(0) i add to it (to wait exactly 20 frames no matter what’s the fps of the game)

3 Likes

You don’t need the wait zero to wait 20 frames, actually. However, you should be able to add another repeat block and put stuff into it. Hope that helps while we wait for a fix.

@t1_hopscotch suggestion for behavior in treating empty Ability IDs: If the ability doesn’t exist, it should be added with the block being put into the container. Don’t know if that behavior was changed, but I thought it used to do that too.

2 Likes

boop, here @Crosbyman64

1 Like

I am aware. I was just giving them a heads up that it was still occurring.