Repository navigation
[5.x] Allow notification to expire - #25892
Merged
Merged
Conversation
Backport of #25723. Typed properties, named arguments and the never and mixed types are rewritten for PHP 7.2.
Backport of #25724. Leaves out the 6.x-only mailSettingsUpdated event, adds the General_InvalidValueForParameter text 5.x lacked, and moves the specs to jest.
Backport of #25819. Leaves out the 6.x-only mailSettingsUpdated event and moves the specs to jest.
Backport of #25830. expiresAt is a docblock-typed property for PHP 7.2.
…shot Http::sendHttpRequestBy no longer declares @throws, so the CliMulti entry no longer matches. The screenshot shows the new [mail] oauth settings.
…041-smtp-oauth-settings-ui-5x
…-login-retirement-warning-5x
cancel() only unsets the session key when it is set, and the tests keep global state so php-di's deprecations stay hidden on PHP 8.5+.
…ation-expiry-date-5x
With it disabled, php-di 6 deprecations fail the separate process on PHP 8.5+.
…-login-retirement-warning-5x # Conflicts: # plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js # plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js
…ation-expiry-date-5x
tzi
marked this pull request as ready for review
December 1, 2026 19:31
tzi
reviewed
Dec 1, 2026
tzi
left a comment
Contributor
There was a problem hiding this comment.
Not blocking: #25830 got a few changes after review, and this backport doesn't have them yet:
- "Stop building the SMTP warning once it has expired": the
EXPIRY_DATEconstant, and the!Date::now()->isEarlier(...)check in the condition that callsself::cancel(). - Its test,
testDoesNotRememberTheWarningAsShownFromJanuary2027. - "Mark the SMTP warning class as internal and temporary": the
@internaltag onSmtpBasicAuthRetirementNotification. - The shorter
CHANGELOG.mdentry: "Piwik\Notification::$expiresAt: a Unix timestamp from which the notification is no longer shown."
Without 1, from January 2027 notifyIfNeeded() still builds the whole warning on every admin page. notify() then drops it, but shown is still set in the session, although nothing was posted.
Could we bring these over? For the test in a separate process, @preserveGlobalState disabled can be left out, like in ManagerTest.
From January 2027 the warning is skipped before it is built, and the session no longer remembers it as shown. The changelog entry only describes the new property.
It is to be removed after December 2026.
Base automatically changed from
smtp-password-login-retirement-warning-5x
to
5.x-dev
December 1, 2026 22:45
…y-date-5x # Conflicts: # CHANGELOG.md # core/ExceptionHandler.php # core/Mail/Transport.php # plugins/CoreAdminHome/SmtpBasicAuthRetirementNotification.php # plugins/CoreAdminHome/tests/Integration/SmtpBasicAuthRetirementNotificationTest.php # plugins/CoreAdminHome/tests/UI/SmtpBasicAuthRetirementNotification_spec.js # tests/PHPUnit/Integration/Mail/TransportTest.php
nathangavin
approved these changes
Dec 1, 2026
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.
Description
Backport of #25830 to 5.x-dev, for 5.14.4. Stacked on #25891 and has to be merged after it.
Changes from the original:
Notification::$expiresAthas a@var int|nulldocblock instead of the?inttype, for PHP 7.2. The separate-process test drops@preserveGlobalState disabled, because on PHP 8.5+ php-di 6 prints deprecations in the child process and PHPUnit fails the test. #25830 is not merged yet, so this follows it if it changes.DEV-21141
Microsoft 365 stops accepting SMTP password logins by default at the end of December 2026. After that date, the warning added in #25891 would be stale. This PR lets a notification carry an expiry time, then sets the end of December 2026 as the expiry for that warning.
It is stacked on #25891 and has to be merged after it.
Changes
Piwik\Notification::$expiresAtproperty, typed?int: a Unix timestamp from which the notification is no longer shown. It defaults tonull, which means the notification never expires, so existing notifications behave as before.Notification\Manager::notify()doesn't post a notification that has already expired, and returnsfalsefor it. If a notification with the same id was posted earlier, it is removed.2027-01-01 00:00UTC.Testing
Checklist
[✔] I have understood, reviewed, and tested all AI outputs before use
[✔] All AI instructions respect security, IP, and privacy rules