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

RemoteBCL updateMeasures does not reliably remove old version #5128

Closed
macumber opened this issue Mar 27, 2024 · 1 comment · Fixed by #5129
Closed

RemoteBCL updateMeasures does not reliably remove old version #5128

macumber opened this issue Mar 27, 2024 · 1 comment · Fixed by #5129
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed

Comments

@macumber
Copy link
Contributor

macumber commented Mar 27, 2024

Issue overview

RemoteBCL updateMeasures is supposed to remove the old version of the measures that are updated.

Current Behavior

Currently, the updateMeasures gets the measure after download by uid only, meaning there is a 50/50 chance that it won't remove the old version.

Expected Behavior

RemoteBCL updateMeasures should remove old measure by version id and uid

Steps to Reproduce

  • Download several measures using RemoteBCL
  • Update measures on remote BCL
  • Call RemoteBCL updateMeasures

Possible Solution

https://github.com/NREL/OpenStudio/pull/5127/files

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): Windows
  • Version of OpenStudio (if using an intermediate build, include SHA): v3.7.0

Context

RemoteBCL updateMeasures is leaving old measures behind

@macumber macumber added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Mar 27, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented Mar 27, 2024

https://www.sqlite.org/lang_select.html

  1. The ORDER BY clause

If a SELECT statement that returns more than one row does not have an ORDER BY clause, the order in which the rows are returned is undefined. Or, if a SELECT statement does have an ORDER BY clause, then the list of expressions attached to the ORDER BY determine the order in which rows are returned to the user.

std::string statement = "SELECT version_id FROM Measures WHERE uid='" + escape(uid) + "'";

jmarrec added a commit that referenced this issue Mar 27, 2024
Fix #5128 - Properly remove old components/measures when updating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed
Projects
None yet
2 participants