Skip to content

[BUGFIX] detect and surface site settings write failures - #20

Merged
sfsmfc merged 4 commits into
developfrom
bugfix/silent-settings-write-failure
Sep 8, 2026
Merged

sfsmfc merged 4 commits into
developfrom
bugfix/silent-settings-write-failure

Conversation

@sfsmfc

@sfsmfc sfsmfc commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds a SiteSettingsWriteGuard service that provides two pre/post-write checks for SiteSettingsService::writeSettings() callers:

  • assertDirectoryWritable(): pre-flight check before any API call, preventing orphaned remote instances when the config directory is not writable.
  • assertSettingsPersisted(): post-write verification that detects the silent write failure caused by the TYPO3 core bug tracked in https://forge.typo3.org/issues/110550.

All three write sites (InstanceRegistrationService, ApiKeyService, AnalyticsStatusService) are updated accordingly. InstanceRegistration throws on failure; the other two log and return silently, as they run on every dashboard load or background sync.

Resolves: #19


Adds a SiteSettingsWriteGuard service that provides two pre/post-write
checks for SiteSettingsService::writeSettings() callers:

- assertDirectoryWritable(): pre-flight check before any API call,
  preventing orphaned remote instances when the config directory is
  not writable.
- assertSettingsPersisted(): post-write verification that detects the
  silent write failure caused by the TYPO3 core bug tracked in
  https://forge.typo3.org/issues/110550.

All three write sites (InstanceRegistrationService, ApiKeyService,
AnalyticsStatusService) are updated accordingly. InstanceRegistration
throws on failure; the other two log and return silently, as they run
on every dashboard load or background sync.

Resolves: #19
@sfsmfc
sfsmfc force-pushed the bugfix/silent-settings-write-failure branch from d6a7b70 to 7d2debd Compare August 28, 2026 14:57
Comment thread Classes/Service/SiteSettingsWriteGuard.php Outdated
Comment thread Tests/Functional/Controller/BackendModuleControllerTest.php Outdated
Comment thread Tests/Unit/Service/SiteSettingsWriteGuardTest.php Outdated
Comment thread Classes/Service/ApiKeyService.php Outdated
Comment thread Classes/Service/SiteSettingsWriteGuard.php Outdated
Comment thread Classes/Service/SiteSettingsWriteGuard.php Outdated
Comment thread Classes/Service/SiteSettingsWriteGuardInterface.php Outdated
Comment thread Classes/Service/SiteSettingsWriteVerifier.php
Comment thread Tests/Functional/Service/AnalyticsStatusServiceTest.php Outdated
Comment thread Tests/Unit/Controller/BackendModuleControllerTest.php
Comment thread Tests/Unit/Service/AnalyticsStatusServiceTest.php
Comment thread Tests/Unit/Service/ApiKeyServiceTest.php
Comment thread Tests/Unit/Service/InstanceRegistrationServiceTest.php
Comment thread Tests/Unit/Service/SiteDataProviderTest.php Outdated
Comment thread Tests/Functional/Service/SiteSettingsWriteGuardTest.php Outdated
- riname SiteSettingsWriteGuard → SiteSettingsWriteVerifier (incl. interface)
- make SiteSettingsWriteVerifier final
- remove $sitesConfigPath test-seam; use Environment::getConfigPath() directly
- simplify exception messages to only include the site identifier
- improve ApiKeyService log message for writeSettings failure
- add `use` statements for SiteSettingsWriteVerifierInterface in all test files
- move SiteSettingsWriteVerifierTest to Functional, drop assertDirectoryWritable tests
- drop posix_getuid() root check from tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the whole test file removed, when only one test needed to be fixed?

Comment thread Tests/Unit/Service/ApiKeyServiceTest.php Outdated
@sfsmfc
sfsmfc requested a review from buchmarv September 8, 2026 07:25
@sfsmfc
sfsmfc merged commit 701ecaa into develop Sep 8, 2026
10 checks passed
@sfsmfc
sfsmfc deleted the bugfix/silent-settings-write-failure branch September 8, 2026 07:39
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.

Registration reports success although credentials were never persisted

3 participants