Commit b82f755
fix(outcomes): Sort CLIENT_DISCARD_REASONS for binary_search (#7655)
Sort the `CLIENT_DISCARD_REASONS` array alphabetically so that
`binary_search` works correctly.
The list was not sorted, with `buffer_overflow` appearing at the end
instead of its correct alphabetical position between `before_send` and
`cache_overflow`. Since `binary_search` requires a sorted slice, it
would fail to find `buffer_overflow` and incorrectly set the reason to
`None`.
Also adds a test to verify the list remains sorted, preventing future
regressions when new reasons are added.
Co-authored-by: Claude <[email protected]>1 parent f1eb68e commit b82f755
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
41 | | - | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
129 | 137 | | |
0 commit comments