Skip to content

Align the vendored client with MCRIT 1.12.0 and route split panes to their tab - #30

Merged
danielplohmann merged 7 commits into
familiary:mainfrom
r0ny123:follow-ups
Oct 12, 2026
Merged

danielplohmann merged 7 commits into
familiary:mainfrom
r0ny123:follow-ups

Conversation

@r0ny123

@r0ny123 r0ny123 commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-ups from the review of #17:

  • Align the vendored McritClient with MCRIT 1.12.0's client #28: the vendored McritClient matches MCRIT 1.12.0's client. Every method both clients have takes the same parameters:

    • sample_group_only only on requestMatchesCross;
    • the constructor's raise_client_errors, raise_server_errors and timeout (default (10, None)), with handle_response's raising modes and MCRIT's error classes;
    • getQueueData's username, sample_ids and job_ids, with the selectors URL-encoded;
    • the unique-block requests' covers_required and min_instructions.

    The plugin's own setTimeout and request helpers stay, and the plugin still sets its timeout from mcrit_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_view now looks for the widget whose frame shares a tab with it, using UIContext.getAllViewFramesForTab. Before, it took the first widget of the file. The Binary Ninja GUI test splits its tab through SplitPaneContainer.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: NumberQTableWidgetItem compares 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:

  • ruff is clean, and pytest passes 212 plus one PySide6 test that is skipped without PySide6. With PySide6 installed, all 216 pass.
  • The metadata and settings sync checks and actionlint pass.
  • The Binary Ninja 6.0 GUI test (170 checks) passes.
  • The IDA 9.3 GUI test in autonomous mode, -A (145 checks), passes, and so do the IDALib and headless tests.

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 danielplohmann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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:

  1. A timeout of 0 no longer means "no limit" (inline on CHANGELOG.md).
  2. getQueueCount is missing although the changelog says the interface now matches 1.12.0 (inline on McritClient.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.

Comment thread CHANGELOG.md Resolved
@danielplohmann

Copy link
Copy Markdown
Collaborator

A correction to the last paragraph of my review: I checked those four client behaviours against core main (v1.13.0) now, not only against 1.12.0, and only one of them is still an open core issue.

  • getJobCount's unencoded filter is fixed in core since 1.13.0 (params={"filter": filter}, from mcrit#236). That is a newer version than this PR aligns to, so it is fine to leave for the next alignment; no change needed here.
  • An empty sample_ids/job_ids list is not a bug. The server deliberately selects nothing for it (_sample_ids_condition), the same as the in-process API, so sending it is consistent.
  • 201/204 raising under raise_server_errors is intended: core documents that "any status this client does not know" raises, and the server only answers 200/202.
  • The unguarded response.json() on a 2xx is real, and in core too: a non-JSON 200 raises JSONDecodeError in both modes. Filed as McritClient raises JSONDecodeError for a 2xx whose body is not JSON, in both error modes mcrit#257; it gets fixed there first and mirrored here afterwards, so nothing to do in this PR.

The two requested changes (the timeout of 0, and getQueueCount) stand as they were.

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.
@r0ny123

r0ny123 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Both points and the suggestion are addressed as separate commits; details are in the inline replies.

  • 61d3ead: a timeout of 0 means no limit again.
  • 8195553: added getQueueCount, matching 1.12.0.
  • f82d502: one sort key for mixed columns, as you suggested.

The suite passes (220 tests). Thanks for the correction on the client issues. Only the unguarded response.json() remains, tracked in familiary/mcrit#257; I will mirror the core fix here once it lands.

The later PRs in the stack (#33–#41) have these commits merged in.

danielplohmann
danielplohmann previously approved these changes Oct 12, 2026

@danielplohmann danielplohmann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 danielplohmann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@danielplohmann
danielplohmann merged commit 3a987ba into familiary:main Oct 12, 2026
10 checks passed
@r0ny123
r0ny123 deleted the follow-ups branch October 15, 2026 19:49
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.

2 participants