-
Notifications
You must be signed in to change notification settings - Fork 159
Use extracted dartdoc texts in search. #1428
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
Conversation
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.
lgtm
app/lib/search/backend.dart
Outdated
}).toList(); | ||
results.sort((a, b) => a.relativePath.compareTo(b.relativePath)); | ||
return results; | ||
} catch (e, st) { | ||
_logger.warning('Parsing dartdoc index.json failed.', e, st); | ||
_logger.warning('Parsing pub-data.json failed.', e, st); |
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.
If pub-data.json is made by us and not by users, then that sounds like an error to me (we'll certainly want to know about it). What makes this case plausible? The return null can be moved into the catch body.
Maybe the caller should have this try block instead of wrapping the whole function? This function also doesn't know the data came from 'pub-data.json'.
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.
good point, fixing both.
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.
The parse error could happen if we change the format in a breaking way, and an older client reads the new format, or a newer client reads the old format, and they are not prepared for some kind of new structure.
final indexJsonFutures = Future.wait(packages.map((p) => | ||
dartdocClient.getContentBytes(p.name, 'latest', 'index.json', | ||
final pubDataFutures = Future.wait(packages.map((p) => | ||
dartdocClient.getContentBytes(p.name, 'latest', 'pub-data.json', |
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.
Does pub-data.json already exist?
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.
Prod: not yet, but it will with the next release.
#1179