Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

CDK sometimes overwrites my control schema with that of another project #139

Open
gostay opened this issue Jun 27, 2018 · 3 comments
Open

Comments

@gostay
Copy link

gostay commented Jun 27, 2018

Steps to Reproduce

  • set up two projects with obviously different control schemas (e.g .the first control has a different name)
  • in each project, open the Control Schema view in the CDK (and close the project) so that the control schema view is automatically open whenever that project is open (I don't know if this step is essential).

Repeat the following steps 3 or 4 times, and do it all fairly quickly

  • open project A
  • quickly (before the webpack server has finished getting started) close project A
  • open project B
  • quickly (before the webpack server has finished getting started) close project B

After 3 or 4 cycles through this, back and forth between the projects, stop and look at the control schema. If the bug happened (the above is pretty reliable for me), one of the project's control schemas will have overwritten the other.

Error

  • The control schema is overwritten permanently with the wrong values.

(a variant result, only sometimes happens)

  • The control schema for a project is sometimes displayed wrong (and saved to .cdk/worldSchema.json wrong!), and closing and opening the control schema view will show the correct schema again (and will write it out correctly to .cdk/worldSchema.json!)

Important Note

I realize the above repro steps are insane, but here's the thing: Four of us been running into some variant of this bug repeatedly for over a month, through normal usage, and this is the first time I've finally had some way to repro it.

There may be various other ways to repro the bug - I have no idea. I do know that it happens during normal usage for us, silently, and the only sign we have of it is when our custom control communication breaks and we start looking into why, and realize the devil bug has struck again. Sometimes we've even uploaded the bogus schema along with the bundle without noticing, since that's the default.

At first I thought it was overwriting my schema with the default schema, but now I think maybe that was just because some of my projects use the default schema?

In any case, I think it's probably important for this bug that we work on a wide variety of CDK projects over a short period of time.

Our workaround so far: Make sure you have a legit copy of the schema saved, so you can easily restore from a saved copy when it gets screwed up.

Further Important Note

This bug is the devil.

Editor Details

Version: 1.0.1
Mixer User ID: 32316796

Encrypted Editor State: {"id":"16ca5bef3a7a449f","password":"t3zBa5Dgz7+1pzmlXT91al7zDqHIyvEWFkrd79dftSQ="}

@gostay
Copy link
Author

gostay commented Jun 27, 2018

I just now hit this bug without any fancy steps like the above. I didn't open any other project after launching the CDK - just my main project. I just rebuilt built my project and noticed the working schema had been overwritten with defaults.

So, it does look like sometimes the schema gets overwritten by the default schema ("my_first_button", "my_awesome_joystick"), not necessarily a schema from another project.

So, I still don't have great repro steps. It just happens from time to time, even with very simple actions.

@dori4n
Copy link

dori4n commented Jul 7, 2018

Yes, you always have to download the active control schema from the dev lab first, or the default will be in there... the Upload Control Schema checkbox should also not be checked by default...

@gostay
Copy link
Author

gostay commented Jul 7, 2018

Hmm... it's actually pretty inconsistent for me. I upload my bundle a lot, without downloading or changing the schema, and most of the time (maybe 24/25 uploads) everything's fine. It's only sometimes that the schema gets overwritten either with the default or with that of another project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants