[FIX] multiple notification observers caused by awakeFromNib#531
[FIX] multiple notification observers caused by awakeFromNib#531hannesa2 merged 1 commit intogitx:masterfrom
Conversation
|
I invited you to be able to push directly to this repository. This will enable the screenshot compare mechanism to add screenshots to the pull request |
|
I'm currently still not too deep into the action script of this project but what is compared here? The screenshot between x86 and ARM version of Gitx? |
|
The screenshots as they look like on master and the screenshots as they look like at current branch. |
You can see here, what it will find #517 if the screenshot differs |
…eFromNib into init
25b4789 to
8bd9584
Compare
|
Interesting! Ok, I try to make an PR on original project, not the forked one. |
|
mh....doesn't work ??? ah....to confirm the invitation helps 😊 |
|
Ok, I isolated now my changes to only the first issue. The other changes takes more time. I'm on the way but I recognized some misbehavior I will check later. So this PR here right now reduces the spawned external gitx commands to only ~5 calls and only when partly staged from a changed file. Together with my previous PR we reduced the spawning processes from ~thousands to only 5! I'll make the additional changes in an new PR which hopefully reduce that to one or two calls in the end. But this could be done later. |
|
As the copy of this #533 build without errors, I merge this |
Yes, I'll do 👍 |

Description:
The observer for
_repositoryUpdatedNotificationwas previously added inawakeFromNib. SinceawakeFromNibis called every time the NIB referencesthe controller, this resulted in multiple observers being registered for the
same instance.
As a consequence, a single notification triggered the handler multiple times
(typically 8–10), causing unnecessary notification traffic and repeated
external
gitxcommand executions.The
addObserver(...)call has been moved to the controller’sinit(...)method so the observer is registered only once when the controller is created.