Skip to content

[Bug] TITLE CHANGE: Cancelling "Save design info" dialog during "Save as..." REVERTS MOST RECENT CHANGE to component/simulation #2680

Closed

Description

@jimmiedave

Describe the bug

Ignore just about everything below in this comment. Scroll down to 15 May, 2025

Adding (by accident) and deleting a simulation without first creating a new config makes bad things happen upon save.

Expected behavior

OR works reliably when deleting an accidentally-created simulation.

To Reproduce

  1. With a fresh instance of OpenRocket, File>Open example>TARC payload rocket.
  2. Cancel "Rocket configuration" dialog.
  3. Click to Flight simulations tab.
  4. Click "New simulation", OK its dialog.
  5. Click "Delete simulations" (the just-added sim is highlighted already)
  6. OK the "are you sure" dialog
  7. Click "Motors & Configuration" tab. Note the existing single config for [None;F50-9] - this is as it should be.
  8. Click "New Configuration".
  9. Select an Aerotech E30-4 from the dialog (probably not important which motor) and OK the motor selection dialog.
  10. Note presence of configs for [None;F50-9] and [None;E30-4] - this is as it should be.
  11. Click the "Flight simulations" tab.
  12. Note two simulations, one for each of the two configs - this is as it should be.
  13. Save the file
  14. Cancel the "Save design info" dialog, and click Yes for the "are you sure" warning.
  15. BEFORE selecting a file name, note that the Flight simulations tab has now lost the motor for Simulation 2
  16. Save the file someplace convenient.
  17. Choose a filename and save
  18. Save "Only summary data"
  19. Quit OpenRocket.

Note that items 20 and forward refer to a table resizing issue on macOS that's probably related to the problems with the OR file. But the file has already been saved without a motor, and if it's corrupt, it already is by this point.

  1. Re-open OpenRocket by double-clicking on the saved-file.ork icon (File>Open will not repro the macOS table re-sizing behavior from opening the (corrupt?) file).
  2. Click on "Flight simulations" tab.
  3. Click on "Simulation 2" (or [SHIFT]+click to add "Simulation 2")
  4. Click "Run simulations".
  5. Click on Motors & Configuration tab.
  6. Note that there are no configurations. In actuality, on macOS, the Motors and Configuration window has (as a result of these steps) been sized down so only the column titles show. The configurations are there (one with no motor), visible after making more space in the Motors & Config window. Discovered this after more testing. Not resizing in this way on Win ARM64 and Linux ARM64.
### Screenshots / .ork file

Screenshot: no configs configs area has been resized to column titles only:

Image

Screenshot: Config 2 motor gone before file named or written to disk:

Image

.ork file:

junk2.ork.zip

Junk3.ork.zip

OpenRocket version

24.12 b1

What platform are you running on?

macOS

Additional context

macOS 14.7.1 Apple silicon M3 MAX, 36GB RAM

Activity

  1. jimmiedave commented on Jan 21, 2025

    @jimmiedave
    ContributorAuthor

    This issue appears consistent in version 23.09 as well - though OR refuses to run the simulation upon load with "No motor" on 23.09

  2. jimmiedave commented on Jan 21, 2025

    @jimmiedave
    ContributorAuthor

    Apparent corruption occurs on Win 11 ARM (Parallels VM), but not the "no configurations" on reload problem.

    Likewise on Ubuntu 24.04 ARM (Parallels VM): motor disappears, but reload does not demonstrate "no configurations".

  3. jimmiedave commented on Jan 22, 2025

    @jimmiedave
    ContributorAuthor

    Edited orig details to clarify what's actually happening to Motors & Config on macOS

  4. changed the title [-][Bug] Insert and delete a simulation without a new configuration [corrupts .ork file on save, I guess][/-] [+][Bug] TITLE CHANGE: Cancelling "Save design info" dialog during "Save as..." REVERTS MOST RECENT CHANGE to component/simulation[/+] on May 15, 2025
  5. jimmiedave commented on May 15, 2025

    @jimmiedave
    ContributorAuthor

    UPDATED:

    After further experimentation, this issue affects not only simulation motors, but any component change. From experimentation, the issue does not appear to affect rearranging components in the rocket component tree.

    Cancelling the "Save design info" dialog as part of a "Save As..." operation reverts the last component or sim change.

    Note that the "Save design info" dialog explicitly states that filling it is optional.

    Several demos:

    Motor disappears from sim

    1. Open OpenRocket 24.12 RC.01.
    2. Open File>Open example>A simple model rocket.
    3. OK the info dialog.
    4. Click on "Motors & Configuration" tab.
    5. Click [New Configuration].
    6. Add a motor (I chose an Estes C5, default parameters).
    7. Click "Flight simulations" tab.
    8. Note that "Simulation 6" has the selected motor from the new configuration.
    9. Select all simulations.
    10. Click [Run simulations].
    11. Note that "Simulation 6" still has the selected motor.
    12. File>Save as...
    13. Cancel the Save Design info dialog
    14. [Yes] discard the info dialog
    15. BUG by the time the "Save as OpenRocket ork file" dialog appears, "Simulation 6" no longer has a motor.

    Most recent change to a component disappears

    1. Open OpenRocket 24.12 RC.01.
    2. Open File>Open example>A simple model rocket.
    3. OK the info dialog.
    4. Select the "Trapezoidal fin set" for editing
    5. Set "Position relative to: Bottom of the parent component plus" to "-9 in"
    6. OK the fin set dialog
    7. Select the "Inner Tube" for editing
    8. Set "Position relative to: Bottom of the parent component plus" to "4 in"
    9. OK the Inner Tube dialog
    10. Note that the fins are very far forward, and the motor mount is out of the back of the rocket, aft by some distance.
    11. File>Save as
    12. Cancel the Save Design info dialog.
    13. [Yes] discard the info dialog
    14. BUG by the time the "Save as OpenRocket ork file" dialog appears, the Inner Tube is back in the rocket, but the fins are still far forward.

    below images are a test with only a single component change: fin position
    Image

    Image

    No effect on rearranging component tree

    1. Open OpenRocket 24.12 RC.01.
    2. Open File>Open example>A simple model rocket.
    3. OK the info dialog.
    4. In the component tree, drag the "Body tube" above the "Nose cone" to re-order the design.
    5. Note that the Nose cone is aft of the motor
    6. File>Save as...
    7. Cancel the Save Design info dialog
    8. [Yes] discard the info dialog
    9. NO BUG the rocket design is unchanged.
  6. added a commit that references this issue on May 21, 2025
    cc51e1e
  7. jimmiedave commented on May 21, 2025

    @jimmiedave
    ContributorAuthor

    OK, I believe I've fixed this (and will need a hand setting up the PR - very new to that).

    Code had been copied and pasted from RocketComponentConfig.java into the SaveDesignInfoPanel. The code had two items that were unnecessary in SaveDesignInfoPanel:

    The first made SaveDesignInfoPanel sensitive to a Preferences setting that was meant to only affect RocketComponentConfig. Triggering this code in a specific way forced a spurious document.undo(), which removed the prior component, config or sim change.

    The second also added a spurious document.undo() as the "cancel" action for the SaveDesignInfoPanel dialog, likewise undoing the prior component, config or sim change.

    This code removed, the RocketComponentConfig code appears to work as designed, and the SaveDesignInfoPanel appears to be cancellable without undoing work user has just done.

  8. added 2 commits that reference this issue on May 26, 2025
    cd946a0
    56cdced
  9. added a commit that references this issue on Jun 29, 2025
    920315a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions