Skip to content

Conversation

@swaroopsalvi
Copy link
Contributor

This is a temp bug fix for wtireToDB / AutoSave.

swaroopsalvi and others added 30 commits February 10, 2025 16:44
…mit-Data-in-database-for-Component-ComponentList-and-ComponentSet
…ished/IIA-1367-Implement-Capability-to-Submit-Data-in-database-for-Component-ComponentList-and-ComponentSet

# Conflicts:
#	kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
…ished/IIA-1367-Alternate-approach-Implement-Capability-to-Submit-Data-in-database

# Conflicts:
#	kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
Feature/finished/iia 1456: Exception Triggered when we click on "Tink…
…ished/IIA-1367-Alternate-approach-Implement-Capability-to-Submit-Data-in-database
…ished/IIA-1367-Alternate-aproach-autosave-and-retrive

# Conflicts:
#	kview/src/main/java/dev/ikm/komet/kview/klfields/KlFieldHelper.java
#	kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/GenEditingDetailsController.java
#	kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
swaroopsalvi and others added 15 commits March 11, 2025 13:04
Feature/finished/iia 1279 score order search matching (#312)
Feature/finished/iia 1279 score order search matching (#312)
…ished/IIA-1367-Alternate-aproach-autosave-and-retrive

# Conflicts:
#	kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
…ished/IIA-1602-writeToDatabase-and-autosave-temp-bug-fix

# Conflicts:
#	kview/src/main/java/dev/ikm/komet/kview/mvvm/view/genediting/SemanticFieldsController.java
Copy link
Contributor

@dholubek dholubek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had a couple comments for adding javadocs to public methods

}

public static int calculteHashValue(List<ObservableField<?>> observableFieldsList ) {
StringBuilder stringBuilder = new StringBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have a brief javadoc for this method?

return observableFields.get(fieldRecord.fieldIndex());
ImmutableList<ObservableSemanticVersion> observableSemanticVersionImmutableList = observableSemanticSnapshot.getHistoricVersions();
if(uncommitted || observableSemanticVersionImmutableList == null || observableSemanticVersionImmutableList.isEmpty()){
//Get the latest version which is uncommited version
Copy link
Contributor

@dholubek dholubek Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put spaces before after the if condition and the else keyword like this:

if (uncommited) {
} else {

instead of

if(uncommited){
}else{

return entityVersionLatest.get();
}

public static int calculteHashValue(List<ObservableField<?>> observableFieldsList ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also include the Semantic's reference component's publicId?
My reasoning: During create (new Semantic) the user can change the reference component. the hash is stating any change. By default a reference component during created would be TinkarTerms.ANONOUMOUS_CONCEPT (I can't remember).

public static int calculteHashValue(List<ObservableField<?>> observableFieldsList ) {
StringBuilder stringBuilder = new StringBuilder();
observableFieldsList.forEach(observableField -> {
stringBuilder.append(observableField.valueProperty().get().toString()).append("|");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe out of scope for this issue but we might want to be careful and not just use toString for complex values like IntIdSet and IntIdList but actually iterate through those collections (when that's the case) and do toString on each item. toString for those collections are usually really meant for debugging purposes, etc and not as a reliable source of how whether the list or set was changed. Example: a toString for a Set or List might return the same value for 2 different Sets or Lists when the only difference is the order that they have.
Bottomline toString for a complex object (IntIdSet or IntIdList) is not reliable as a way to know exactly what they contain. But again might be out of scope for this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good to know. But I think we can get away with it for now. I believe IntIdSet and List had aways provided a toString() to dump out an array representing all elements. To be more accurate I think iterating through each is technically better.

Another minor concern I have might be that as a user (in a String/Text) field typing that each keystroke would have to exercise this (expensive) validation code. Not sure if large fields could in fact appear slow.

@swaroopsalvi swaroopsalvi requested a review from aks8m March 17, 2025 18:10
Copy link
Contributor

@carldea carldea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks @swaroopsalvi !

@swaroopsalvi swaroopsalvi merged commit 25f6ebd into ikmdev:main Mar 17, 2025
6 checks passed
@swaroopsalvi swaroopsalvi deleted the feature/finished/IIA-1602-writeToDatabase-and-autosave-temp-bug-fix branch May 8, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants