Skip to content

Use the JSON-serialized SearchRequestData for request-passing to the search isolate. #8896

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

Merged
merged 1 commit into from
Aug 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/lib/service/entrypoint/search_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ Future<void> main(List<String> args, var message) async {
final info = await searchIndex.indexInfo();
return ReplyMessage.result(info.toJson());
} else if (payload is String) {
final q = ServiceSearchQuery.fromServiceUrl(Uri.parse(payload));
final q = ServiceSearchQuery.fromSearchRequestData(
SearchRequestData.fromJson(
json.decode(payload) as Map<String, dynamic>));
final rs = await searchIndex.search(q);
return ReplyMessage.result(json.encode(rs.toJson()));
} else {
Expand Down Expand Up @@ -131,7 +133,7 @@ class IsolateSearchIndex implements SearchIndex {
FutureOr<PackageSearchResult> search(ServiceSearchQuery query) async {
try {
final rs = await _runner.sendRequest(
Uri(queryParameters: query.toUriQueryParameters()).toString(),
json.encode(query.toSearchRequestData().toJson()),
timeout: Duration(minutes: 1),
);
return PackageSearchResult.fromJson(
Expand Down