fix(types): mark IDocsEntity.mention and mention_count optional#875
Merged
thostetler merged 1 commit intoMay 29, 2026
Merged
Conversation
Both fields were added without optional markers while every adjacent field on IDocsEntity is optional. Solr responses do not guarantee these fields, and the two existing consumers in AbstractSideNav already use optional chaining and falsy guards on doc.mention. Aligning the type with how the data is actually used clears 21 TS2739 errors across test fixtures and mocks (plus 13 cascading typecheck errors).
cc6fb93 to
17993da
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Risk summary: Low risk. This change only loosens TypeScript types for two fields on IDocsEntity, aligning the model with existing optional-guarded usage patterns and likely API behavior (fields may be omitted).
Changes:
- Make
IDocsEntity.mentionoptional (mention?: string[]). - Make
IDocsEntity.mention_countoptional (mention_count?: number).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #875 +/- ##
========================================
- Coverage 62.6% 62.6% -0.0%
========================================
Files 324 324
Lines 38203 38203
Branches 1733 1732 -1
========================================
- Hits 23903 23900 -3
- Misses 14259 14262 +3
Partials 41 41
🚀 New features to boost your workflow:
|
shinyichen
approved these changes
May 29, 2026
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.
Fix some eslint issues