Repository navigation
Build a fresh SMDA report outline per function query (1.1.10) - #18
Merged
Merged
Conversation
SMDA 4.8 memoises SmdaReport.getFunctions() into _sorted_functions on the first call. getLocalSmdaReportOutline() returned one cached outline object and FunctionMatchWidget only swapped its xcfg per query, so from the second function onward the outline still yielded the first function. The query then found that offset already in function_matches, skipped the server call, and the widget found nothing under the offset it had asked about: Function Scope showed no matches for every function after the first. Cache the outline as a dict and build a fresh SmdaReport from it per call. Track the report the dict was derived from, so replacing local_smda_report (the upload-on-close path) no longer leaves the outline on the old report's metadata. Bumps to 1.1.10. The smda pin is unbounded (>=4.3.10), so 1.1.9 is affected for anyone installing today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
danielplohmann
force-pushed
the
fix/smda-48-outline-per-query
branch
from
September 16, 2026 06:43
c0155c1 to
31ccb46
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Function Scope returns no matches for every function after the first, for anyone running SMDA 4.8 or later. The
smdapin is unbounded (>=4.3.10), so a fresh install of 1.1.9 today hits this.What happens
SMDA 4.8 memoises
SmdaReport.getFunctions():getLocalSmdaReportOutline()(ida_mcrit.py:193) returned one cachedSmdaReport, andFunctionMatchWidget.updateViewWithCurrentFunction(widgets/FunctionMatchWidget.py:273-274) reassigned.xcfgon that same object for each query. So:_sorted_functionswith A, the server is asked about A, and the result is cached under A's offset..xcfg = {B.offset: B}, butMcritInterface.querySmdaFunctionMatches(helpers/McritInterface.py:322) doeslist(smda_report.getFunctions())and still gets[A].function_matches, so the server call is skipped entirely and nothing is stored for B.B.offset in function_matchesis false,match_reportstaysNone, and the table shows nothing.Silent: no exception, no error in the activity log. Just an empty Function Scope from the second function onward.
Fix
Cache the outline as a dict and build a fresh
SmdaReportfrom it per call, so each query gets its own uncachedgetFunctions(). Also track which report the dict came from, so replacinglocal_smda_reporton the upload-on-close path (ida_mcrit.py:292) doesn't leave the outline carrying the previous report's metadata.Same approach as in #17, ported to the current layout, so the two don't diverge.
Tests
tests/test_smda_report_outline.pyuses a stand-in with SMDA 4.8's caching semantics. Against the unfixed getter,test_outline_is_a_fresh_report_per_queryandtest_outline_follows_a_replaced_local_reportboth fail; with the fix all four pass.Local: 86 pytest passed (82 before),
ruff checkandruff format --checkclean,verify_metadata_sync.py --expected-version 1.1.10,verify_settings_sync.pyandrun_quality_checks.pypass,package_plugin.pybuilds the ZIP with the fix in it.Note on releasing
On current
main, pushingv1.1.10runs the oldrelease.yml, which does not check that the tag matches the declared version. #15 is what adds that guard. Either merge #15 first, or check the tag by hand.🤖 Generated with Claude Code