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
fix(ontology): set the cache earlier in case of only one ontology (DSP-1374) #397
Merged
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3adf891
fix(ontology): set the cache earlier in case of only one ontology
kilchenmann d897e08
Merge branch 'main' into wip/dsp-1374-ontology-loader
kilchenmann d9adac7
Merge branch 'main' into wip/dsp-1374-ontology-loader
f278045
fix(ontology): fix caching issue
kilchenmann 5d8b5fe
refactor(ontology): delete shadowed name
kilchenmann 8b287cc
Merge branch 'main' into wip/dsp-1374-ontology-loader
08ef4c5
Merge branch 'main' into wip/dsp-1374-ontology-loader
mdelez 0f6438d
refactor(ontology): delete commented code
kilchenmann 9c910c4
chore(deps): update package-lock.json
kilchenmann d174ba2
refactor(ontology): clean up async/await function
kilchenmann 0ef9d53
fix(ontology): bug fix in knora system ontology view
kilchenmann e2ae4f9
refactor(ontology): delete shadowed name
kilchenmann 68380d1
refactor(ontology): delete commented code
kilchenmann 2be2a49
fix(ontology): set progress indicator correctly
kilchenmann 4b8e1a5
Merge branch 'main' into wip/dsp-1374-ontology-loader
kilchenmann File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why this method is needed? I'm not a huge fan of
waitFor
and we have stated in our design doc that we shouldn't use setTimeout in production code. How will this behave with a rather slow internet connection?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats happens if wait is over but data is still not ready?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know, that we have this rule in our conventions. But I have no idea how to solve this async requests in another way. I found this solution in a tutorial. Maybe someone of you has a better idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll pull the changes from main and check it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way is:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk if you've already found this @kilchenmann but the issue isn't that the data isn't arriving in time from the API, it's that
this.ontologies
isn't modified in time for the length check withinloadAndCache
so its length is always 0.Without
waitFor
:With
waitFor
:I think it's due to your callback. Admittedly I'm quite horrible at dealing with async/await things but I'm quite certain it's an issue with your callback getting triggered earlier than it should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mdelez
I'm open for better solution than async/await. At the moment I'm lost. Even with the solution from @waychal I'm not 100% successful (yet). I'm pretty sure I'm doing something wrong, but I have no idea what and how to solve it 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I came up with another solution without async/await. See my last commit (d174ba2).