Skip to content

[FIX] multiple notification observers caused by awakeFromNib#531

Merged
hannesa2 merged 1 commit intogitx:masterfrom
SMA-HP:fix/multi-notifications
Mar 15, 2026
Merged

[FIX] multiple notification observers caused by awakeFromNib#531
hannesa2 merged 1 commit intogitx:masterfrom
SMA-HP:fix/multi-notifications

Conversation

@SMA-HP
Copy link
Copy Markdown
Collaborator

@SMA-HP SMA-HP commented Mar 7, 2026

Description:

The observer for _repositoryUpdatedNotification was previously added in
awakeFromNib. Since awakeFromNib is called every time the NIB references
the 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 gitx command executions.

The addObserver(...) call has been moved to the controller’s init(...)
method so the observer is registered only once when the controller is created.

@SMA-HP SMA-HP changed the title [FIX] addObserver in awakeFromNib results in multi observation [FIX] multiple notification observers caused by awakeFromNib Mar 7, 2026
@hannesa2 hannesa2 added the bugfix label Mar 8, 2026
@hannesa2
Copy link
Copy Markdown
Contributor

hannesa2 commented Mar 8, 2026

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

@hannesa2
Copy link
Copy Markdown
Contributor

hannesa2 commented Mar 8, 2026

To be honest I see no diff
image
and I've no clue why git diff-image found some differences

@SMA-HP
Copy link
Copy Markdown
Collaborator Author

SMA-HP commented Mar 8, 2026

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?

@hannesa2
Copy link
Copy Markdown
Contributor

hannesa2 commented Mar 8, 2026

The screenshots as they look like on master and the screenshots as they look like at current branch.
It should help to see if it still starts and the branch changes something in layout, caused by logic or just by layout

@hannesa2
Copy link
Copy Markdown
Contributor

The screenshot between x86 and ARM version of Gitx?

You can see here, what it will find #517 if the screenshot differs

@SMA-HP SMA-HP force-pushed the fix/multi-notifications branch from 25b4789 to 8bd9584 Compare March 10, 2026 17:12
@SMA-HP
Copy link
Copy Markdown
Collaborator Author

SMA-HP commented Mar 10, 2026

Interesting! Ok, I try to make an PR on original project, not the forked one.

@SMA-HP
Copy link
Copy Markdown
Collaborator Author

SMA-HP commented Mar 10, 2026

mh....doesn't work ??? ah....to confirm the invitation helps 😊

@SMA-HP
Copy link
Copy Markdown
Collaborator Author

SMA-HP commented Mar 10, 2026

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 would say this is worth to make a new version of gitx, if you like :)

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.

@SMA-HP SMA-HP marked this pull request as ready for review March 10, 2026 18:00
@hannesa2
Copy link
Copy Markdown
Contributor

As the copy of this #533 build without errors, I merge this

@hannesa2 hannesa2 merged commit c161449 into gitx:master Mar 15, 2026
4 of 6 checks passed
@hannesa2
Copy link
Copy Markdown
Contributor

Together with my previous PR we reduced the spawning processes from ~thousands to only 5!
I would say this is worth to make a new version of gitx, if you like :)

Yes, I'll do 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants