Skip to content

Say which address change actually fires the event (3.3) - #220

Open
nursoda wants to merge 1 commit into
release/3.3from
docs/say-which-address-fires-the-event-3.3
Open

Say which address change actually fires the event (3.3)#220
nursoda wants to merge 1 commit into
release/3.3from
docs/say-which-address-fires-the-event-3.3

Conversation

@nursoda

@nursoda nursoda commented Aug 27, 2026

Copy link
Copy Markdown
Member

3.3 counterpart of #219.

The class docblock of EMailDeleted claimed that every path clearing the address used for delivery goes through IUser::setSystemEMailAddress() and therefore reaches this listener. It does not.

Two paths change the delivery address without dispatching anything usable:

  • Deleting the additional address a user had picked as their notification address calls IUser::setPrimaryEMailAddress('') (apps/provisioning_api/lib/Controller/UsersController.php, branch COLLECTION_EMAIL), which only removes the settings/primary_email user value.
  • occ user:setting <uid> settings primary_email writes or deletes that user value directly — only email and display_name are special-cased in core/Command/User/Setting.php.

After either, getEMailAddress() falls back to the system address, or returns null when the account has none. The account data does emit UserUpdatedEvent on the first path, but before the primary address is reset, so getEMailAddress() read from it still yields the old address. That event is no hook for this, which is why the listener ignores it — a behaviour EMailDeletedTest already pins.

No behaviour changes. There is nothing to react to, and a listener that never runs leaves the provider enabled. That is stricter than disabling it, never a downgrade to password-only.

Deliberately different from #219: no reference to the threat model entry, because this line ships no doc/ directory. It can therefore merge independently of #214.

🤖 Generated with Claude Code, verified, tweaked and approved by @nursoda.

@nursoda nursoda added the documentation Improvements or additions to documentation: instructions, concepts, analyses label Aug 27, 2026
@nursoda nursoda self-assigned this Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The class docblock claimed that every path clearing the address used for
delivery goes through setSystemEMailAddress() and therefore reaches this
listener. It does not. Deleting the additional address a user had picked as
their notification address calls setPrimaryEMailAddress(''), and
`occ user:setting <uid> settings primary_email` writes or deletes that user
value directly — only `email` and `display_name` are special-cased there. Both
drop settings/primary_email without dispatching anything, so delivery falls back
to the system address, or stops altogether when the account has none.

The account data does emit UserUpdatedEvent on the first path, but before the
primary address is reset, so getEMailAddress() read from it still yields the old
address. That event is therefore no hook for this, which is why the listener
ignores it — a behaviour the test suite already pins.

Behaviour is unchanged: there is nothing to react to, and a listener that never
runs leaves the provider enabled, which is stricter than disabling it.

This is the 3.3 counterpart of the main-line commit. It carries no reference to
the threat model: this line ships no doc/ directory.

Signed-off-by: Olav Seyfarth <olav@seyfarth.de>
@nursoda
nursoda force-pushed the docs/say-which-address-fires-the-event-3.3 branch from ce0e495 to 9e4bfff Compare August 27, 2026 10:58
@nursoda
nursoda requested a review from seyfahni August 27, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation: instructions, concepts, analyses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant