Skip to content

Fix force-push sync dispatch#525

Open
amattas wants to merge 2 commits into
binsync:mainfrom
amattas:pr/fix-force-push-sync-dispatch
Open

Fix force-push sync dispatch#525
amattas wants to merge 2 commits into
binsync:mainfrom
amattas:pr/fix-force-push-sync-dispatch

Conversation

@amattas

@amattas amattas commented Jun 15, 2026

Copy link
Copy Markdown

Problem

Manual force-push paths updated BinSync's in-memory master state, but they did not reliably flush those changes through the client commit/update path. That made force pushes appear to succeed in the UI while other environments did not receive the changes.

This also exposed two related sync issues:

  • schedule_job() returned early whenever auto-commit was disabled, which also blocked manual work that still needs to be scheduled explicitly.
  • Function sync could abort before applying address-keyed comments when setting the function itself was a no-op or returned a failure through the remote client.
  • Function force-push did not include comments inside the pushed function range, even though comments are stored as address-keyed artifacts separate from Function.

Solution

  • Add an explicit _flush_force_push_state() helper and call it after function/global/type/segment force-push updates.
  • Keep manual scheduled jobs runnable even when auto-commit is disabled.
  • Isolate function set no-op/failure handling so address-keyed comments can still sync.
  • Force-push comments that fall inside pushed function ranges and normalize raw string comments returned by decompiler APIs into Comment artifacts.
  • Add controller-level tests for persistence, raw string comments, no-op function set behavior, and manual scheduling.

Verification

  • conda run -n ghidra python -m pytest tests -q --ignore=tests/test_angr_gui.py -> 20 passed, 1 warning
  • conda run -n ghidra python -m compileall -q binsync tests
  • git diff --check

Notes

This branch is clean against upstream main and combines the related force-push/comment/scheduler fixes so reviewers do not have to reason about a stacked force-push series.

amattas added 2 commits June 14, 2026 23:34
Comments are an address-keyed artifact, not fields on Function, so
set_function never carried them and the force-push path dropped them
(the long-standing TODO). Snapshot deci.comments once and commit those
that fall within each pushed function's address range (matching
State.get_func_comments), so manual force push now includes comments.
Relies only on deci.comments, so it works against the shipping declib
(4.0.1) without depending on comment.func_addr being populated.
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.

1 participant