Skip to content
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

Science becomes permanently stuck inflight if vessel is destroyed #554

Closed
nateberkopec opened this issue Dec 5, 2019 · 5 comments
Closed
Labels
bug Something isn't working fix in dev science

Comments

@nateberkopec
Copy link

Steps to reproduce:

  1. Orbit with a Science 9001/Materials Study and the part that holds extra science data (forget the name).
  2. Run the Materials Study experiment, transfer the resulting data/sample to the extra container.
  3. Crash/destroy the craft.

The Materials Study science value for whatever biome you ran it in will still show up as "inflight".

@nateberkopec
Copy link
Author

I'm not sure if this affects all science experiments or even if the step of transferring data is necessary, this is just a description of how I encountered the issue.

@nateberkopec
Copy link
Author

I'm guessing this may be because this callback is never called when the craft is completely destroyed?

@nateberkopec nateberkopec changed the title Science becomes permanently stuck inflight if part is destroyed Science becomes permanently stuck inflight if vessel is destroyed Dec 5, 2019
@nateberkopec
Copy link
Author

Ah, this seems likely. Maybe we need to attach to onVesselTerminated and/or onVesselDestroy?

@gotmachine
Copy link
Collaborator

gotmachine commented Dec 5, 2019

I can't test right now but it is very unlikely that it is "permanently stuck", as the in flight data is recalculated from scratch on every deserialization/serialization cycle by iterating on all parts. Are you sure the parts are actually destroyed ? Data sitting on parts/vessels marked as "debris" will still count.

There can be some cases of the inflight science staying a while (until you go trough a reload / scene change) if it was on a vessel that was destroyed while unloaded. Unfortunately there is no reliable way to detect that without risking removing twice the science (and other more harmful consequences).

Edit : this said, we probably should implement some "pre-clearing" method in the VesselData class called on onVesselTerminated and onVesselWillDestroy events, not removing the drive objects references, but removing the data on them.

@nateberkopec
Copy link
Author

There can be some cases of the inflight science staying a while (until you go trough a reload / scene change) if it was on a vessel that was destroyed while unloaded.

Hmm. Not the case for me, as the vessel was loaded when destroyed. I'll fire it up again tonight and try to learn more about the reproduction steps.

the in flight data is recalculated from scratch on every deserialization/serialization cycle by iterating on all parts

Ah, where is this code?

@gotmachine gotmachine added science unconfirmed bug Something isn't working and removed unconfirmed labels Jan 27, 2020
gotmachine added a commit that referenced this issue Jan 27, 2020
… is destroyed

Previously you had to go trough a serialization/deserialization cycle (scene change)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix in dev science
Projects
None yet
Development

No branches or pull requests

2 participants