Skip to content

fix: Split search / suggest results into an array? - #9

Open
webbrain-one wants to merge 1 commit into
atipugin:masterfrom
webbrain-one:webbrain/issue-6
Open

fix: Split search / suggest results into an array?#9
webbrain-one wants to merge 1 commit into
atipugin:masterfrom
webbrain-one:webbrain/issue-6

Conversation

@webbrain-one

Copy link
Copy Markdown

Closes #6

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR changes search and suggestion responses from scalar strings to arrays by splitting Sonic’s space-delimited result payloads.

  • Applies array conversion to both Search#query and Search#suggest.
  • Leaves the existing scalar-return specs and README examples inconsistent with the new API.

Confidence Score: 4/5

The return-type change should not merge until its failing scalar-return assertions and public API examples are updated.

Successful query and suggestion calls now return arrays, while the existing specs and documentation still enforce and advertise scalar results.

Files Needing Attention: lib/sonic/channels/search.rb, spec/sonic/channels/search_spec.rb, README.md

Important Files Changed

Filename Overview
lib/sonic/channels/search.rb Both search operations now return arrays, but the repository’s corresponding tests and public examples still require scalar responses.

Reviews (1): Last reviewed commit: "Return search and suggest results as an ..." | Re-trigger Greptile

execute('QUERY', *arr) do
connection.read # ...
end
execute('QUERY', *arr) { connection.read }.split(' ')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Array return breaks existing contract

When a query or suggestion succeeds, split changes the result from the scalar string required by the existing API assertions and examples into an array, causing those assertions to fail and callers following the documented contract to receive a different type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split search / suggest results into an array?

1 participant