Fix #5128 - Properly remove old components/measures when updating#5129
Merged
Fix #5128 - Properly remove old components/measures when updating#5129
Conversation
9fa472d to
0285e41
Compare
jmarrec
commented
Mar 27, 2024
Comment on lines
+100
to
+104
| // Removes all components with uid but NOT currentVersionId | ||
| size_t removeOutdatedLocalComponents(const std::string& uid, const std::string& currentVersionId); | ||
|
|
||
| // Removes all measures with uid but NOT currentVersionId | ||
| size_t removeOutdatedLocalMeasures(const std::string& uid, const std::string& currentVersionId); |
Collaborator
Author
There was a problem hiding this comment.
New LocalBCL methods. Returns the number removed
| if (oldComponent && oldComponent->versionId() != newComponent->versionId()) { | ||
| LocalBCL::instance().removeComponent(*oldComponent); | ||
| } | ||
| LocalBCL::instance().removeOutdatedLocalComponents(newComponent->uid(), newComponent->versionId()); |
Collaborator
Author
There was a problem hiding this comment.
in updateComponents, remove the outdated local ones if suceeded
Collaborator
Author
There was a problem hiding this comment.
The important bit is explained at #5128 (comment)
getComponent does a sqlite3 SELECT, which does NOT guarantee the order of return is in the same order it was inserted. so we can't use it
| if (oldMeasure && oldMeasure->versionId() != newMeasure->versionId()) { | ||
| LocalBCL::instance().removeMeasure(*oldMeasure); | ||
| } | ||
| LocalBCL::instance().removeOutdatedLocalMeasures(newMeasure->uid(), newMeasure->versionId()); |
Collaborator
Author
There was a problem hiding this comment.
Same on updateMeasures
19 tasks
Collaborator
|
CI Results for 0285e41:
|
Contributor
|
@jmarrec thanks, I like this better |
macumber
added a commit
to openstudiocoalition/OpenStudioApplication
that referenced
this pull request
Jul 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request overview
Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.