fix(init): preserve protocol selection order from server (BLO-802)#739
fix(init): preserve protocol selection order from server (BLO-802)#739
Conversation
Add protocolOrder slice to track insertion order when grouping generators by protocol, ensuring the protocol selection menu displays options in the order the server intended (sorted by weight). Co-authored-by: maoueh <123014+maoueh@users.noreply.github.com>
|
@copilot The plan was to fix all choices related ordering and not just the root generator list. Here a sub questions exhibiting the same problem: You need to fix the bug globally for any other choices |
I see the generator ordering issue you're showing. I've reviewed the code and the generator list is built by iterating Could you clarify which specific "sub questions" or other choice presentations you're seeing ordering issues with? Are you seeing:
This will help me identify if there's another map iteration we need to fix, or if the issue might be server-side (e.g., server sending generators in different orders). |
|
@copilot Ok the other ordering bug was on the server, let merge this one and I will spawn you to fix the sever. |
Protocol choices in
substreams initdisplayed in random order due to Go map iteration having undefined ordering. The server sends generators sorted by weight, but this ordering was lost during client-side grouping.Changes
cmd/substreams/init.goprotocolOrderslice alongside the grouping mapcmd/substreams/init_test.go(new)💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.