For non-empty project check, just query database for 1 word#3756
For non-empty project check, just query database for 1 word#3756imnasnainaec merged 6 commits intomasterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3756 +/- ##
==========================================
- Coverage 72.85% 72.84% -0.01%
==========================================
Files 287 287
Lines 10726 10725 -1
Branches 1331 1331
==========================================
- Hits 7814 7813 -1
Misses 2517 2517
Partials 395 395
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| using var activity = | ||
| OtelService.StartActivityWithTag(otelTagName, "checking if WordsCollection is nonempty"); | ||
|
|
||
| return await _wordDatabase.Words.Find(GetAllProjectWordsFilter(projectId)).Limit(1) |
| Task<List<Word>> Create(List<Word> words); | ||
| Task<Word> Add(Word word); | ||
| Task<bool> DeleteAllWords(string projectId); | ||
| Task<bool> IsWordsNonempty(string projectId); |
There was a problem hiding this comment.
just a nit pick on the name. Having names in the negative can be tricky to reason about in boolean logic. Additionally the only place you're using this right now is in the negative case, which makes a double negative, so !NonEmpty. it might be more straightforward to change it to IsWordsEmpty then it's IsEmpty or !IsEmpty. If you want to keep the current meaning, I would call it HasWords or AnyWords then you don't have a double negative when you want to see if it's empty.
Feel free to ignore this unsolicited input.
imnasnainaec
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 10 files reviewed, 2 unresolved discussions (waiting on @andracc and @hahn-kev)
| Task<List<Word>> Create(List<Word> words); | ||
| Task<Word> Add(Word word); | ||
| Task<bool> DeleteAllWords(string projectId); | ||
| Task<bool> IsWordsNonempty(string projectId); |
| using var activity = | ||
| OtelService.StartActivityWithTag(otelTagName, "checking if WordsCollection is nonempty"); | ||
|
|
||
| return await _wordDatabase.Words.Find(GetAllProjectWordsFilter(projectId)).Limit(1) |
There was a problem hiding this comment.
Reviewed 9 of 10 files at r2.
Reviewable status: 9 of 10 files reviewed, 3 unresolved discussions (waiting on @hahn-kev and @imnasnainaec)
Backend/Controllers/WordController.cs line 107 at r2 (raw file):
public async Task<IActionResult> HasFrontierWords(string projectId) { using var activity = OtelService.StartActivityWithTag(otelTagName, "checking if Frontier is nonempty");
The renaming from "nonempty" is great. Here is another spot for it.
imnasnainaec
left a comment
There was a problem hiding this comment.
Dismissed @hahn-kev from 2 discussions.
Reviewable status: 6 of 10 files reviewed, all discussions resolved (waiting on @andracc and @imnasnainaec)
andracc
left a comment
There was a problem hiding this comment.
Reviewed 4 of 4 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
Resolves #3751
Reduces delay before the Export button in enabled.
This change is