Repository navigation
Align the vendored client with MCRIT 1.12.0 and route split panes to their tab - #30
Conversation
Every method both clients have now takes the same parameters as in MCRIT 1.12.0: - sample_group_only only on requestMatchesCross. MCRIT fails the single-sample requests that carry it. - The constructor takes raise_client_errors, raise_server_errors and timeout (default (10, None)), and handle_response has the raising modes with MCRIT's error classes. - getQueueData takes username, sample_ids and job_ids, and URL-encodes its selectors. - The unique-block requests take covers_required and min_instructions. The plugin's own additions stay: setTimeout and the request helpers that apply the timeout. Methods only MCRIT's client has are outside the trimmed surface. Closes familiary#28
The sidebar picks the widget for a cursor move or an action by its view frame, and fell back to the first widget of the same file and view type when no widget had seen the frame yet. A pane split off inside a second tab therefore reached the first tab's widget. The fallback now first looks for the widget whose frame shares a tab with the new one, using UIContext.getAllViewFramesForTab. The Binary Ninja GUI test splits the tab it runs in and routes the new pane while a stand-in for another tab's widget comes first in the list. Without this change that check fails. Closes familiary#26
NumberQTableWidgetItem compares by value, and text that is neither a number nor hex, such as an empty cell, made that comparison raise inside Qt's sort, which crashes the process under PySide6 6.11. Such a pair now compares as text. No column fills in such text today.
danielplohmann
left a comment
There was a problem hiding this comment.
Thanks for collecting these follow-ups. The split-pane routing and the client alignment look good, and the suite passes locally (216 tests). I compared the vendored client against mcrit/client/McritClient.py at v1.12.0 (blob 4f262f8).
Two things before merge, both about what the changelog promises:
- A timeout of 0 no longer means "no limit" (inline on
CHANGELOG.md). getQueueCountis missing although the changelog says the interface now matches 1.12.0 (inline onMcritClient.py).
One suggestion on the sort fallback (inline). Not for this PR: the unencoded getJobCount filter, empty sample_ids/job_ids lists sent as empty selectors, an unguarded response.json() on a 2xx, and 201/204 treated as failures in raising mode are all identical in core 1.12.0, so per AGENTS.md they get fixed in core first and then mirrored here.
|
A correction to the last paragraph of my review: I checked those four client behaviours against core
The two requested changes (the timeout of 0, and |
MCRIT 1.12.0's client has getQueueCount next to getQueueData: the number of jobs getQueueData would list for the same selection, from /jobs/count, built with the same _job_selection_query. The vendored client said it matched 1.12.0 but lacked it.
McritInterface called setTimeout only for a positive mcrit_request_timeout. With the vendored client's new default timeout of (10, None), a timeout of 0 then kept that default instead of no limit, so a user who set 0 to wait indefinitely got a ConnectTimeout after 10 seconds. setTimeout is now always called; it already maps 0 to None.
NumberQTableWidgetItem compared two numbers by value and fell back to
text otherwise, so a column mixing both had no consistent order
("9" < "10", "10" < "1a", "1a" < "9") and the result depended on
where the rows started. Every item now sorts by one key: numbers by
value, then text.
|
Thanks for the review. Both points and the suggestion are addressed as separate commits; details are in the inline replies.
The suite passes (220 tests). Thanks for the correction on the client issues. Only the unguarded The later PRs in the stack (#33–#41) have these commits merged in. |
danielplohmann
left a comment
There was a problem hiding this comment.
Thanks, both requested changes and the sort suggestion are in. getQueueCount matches core 1.12.0 line for line, and a timeout of 0 maps to no limit again. Lint, the sync checks and the suite (220 tests) pass here.
Once #31 is merged, this conflicts with it in CHANGELOG.md only: both PRs add a bullet under Unreleased/Changed, and keeping both is the fix. While you're there, the getQueueCount line is longer than the file's other lines, so it could be rewrapped.
Keeps both Unreleased/Changed bullets, the off-UI-thread requests from main and the client alignment from this branch, and rewraps the client bullet to the file's line length.
danielplohmann
left a comment
There was a problem hiding this comment.
Thanks for the quick merge. The conflict resolution touches only CHANGELOG.md, keeps both bullets, and rewraps the getQueueCount line. Lint, the sync checks and the suite (223 tests) pass on the merged branch.
Follow-ups from the review of #17:
Align the vendored McritClient with MCRIT 1.12.0's client #28: the vendored
McritClientmatches MCRIT 1.12.0's client. Every method both clients have takes the same parameters:sample_group_onlyonly onrequestMatchesCross;raise_client_errors,raise_server_errorsandtimeout(default(10, None)), withhandle_response's raising modes and MCRIT's error classes;getQueueData'susername,sample_idsandjob_ids, with the selectors URL-encoded;covers_requiredandmin_instructions.The plugin's own
setTimeoutand request helpers stay, and the plugin still sets its timeout frommcrit_request_timeout, so its requests behave as before. Methods only MCRIT's client has (searches,...ByIds,getQueueCount,modifyFunction, index rebuilds) stay out of the trimmed copy.Binary Ninja: route a split pane's sidebar actions to its own tab #26: a split pane routes to its own tab's sidebar. When no sidebar widget has seen a view frame yet,
_widget_for_viewnow looks for the widget whose frame shares a tab with it, usingUIContext.getAllViewFramesForTab. Before, it took the first widget of the file. The Binary Ninja GUI test splits its tab throughSplitPaneContainer.containerForWidget(frame).currentViewPane().splitPane(...)and routes the new pane while a stand-in for another tab's widget comes first in the list. Without the fix that check fails.The nit from the Fix label import, scope queries and settings that shipped wrong in 1.1.10 #23 approval:
NumberQTableWidgetItemcompares a pair whose text is neither a number nor hex as text, instead of raising inside Qt's sort.#25 (moving Binary Ninja's network requests off the UI thread) and #27 (the community-plugins listing, after the first Binary Ninja release) are not part of this PR.
Checks
Local at the head, against MCRIT 1.12.0 and smda 4.9.0:
-A(145 checks), passes, and so do the IDALib and headless tests.