Repository navigation
fix(objects): the routes catch what they were written to catch - #5883
Merged
Merged
Conversation
ObjectsController imported OCP\DB\Exception, so five catch (Exception) blocks took database failures only and every other failure left the route. - create(): a failing webhook interception now never breaks the write (Throwable). - logs(): a failed lookup answers 404 (Exception), logged unless a plain miss. - vectorizeBatch(), getObjectVectorizationStats(): any failure answers the generic 500 (Throwable), now logged, since the text never reaches the client. - validate(): another Exception answers the 500 with its message. An Error stays with the server, so its text does not reach the client. Failures of an external source still leave the routes, for ObjectSourceErrorMiddleware to answer with their own status. Database failures get the same responses as before. The import is gone, so the trap cannot return. The pins from #5856 change with it: testOtherFailuresLeaveTheRoutes is replaced and the golden gains the new log lines. Assisted-by: ClaudeCode:claude-opus-5-5
…tch-what-was-meant
Assisted-by: ClaudeCode:claude-opus-5-5
…tch-what-was-meant
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ❌ | ||||
| psalm | ❌ | ||||
| phpstan | ❌ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ❌ | ||||
| test-l10n-parity | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 165/165 | |||
| npm | ✅ | ✅ 640/640 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ 34608/34610 · 18 skipped | ||||
| Newman | ❌ 1628/1630 | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ❌ |
Quality workflow — 2026-11-06 08:34 UTC
Download the full PDF report from the workflow artifacts.
This was referenced Nov 6, 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.
This changes visible behaviour on purpose.
ObjectsControllerimportedOCP\DB\Exception, so fivecatch (Exception)blocks took database failures only. Every other failure left the route. Each block now catches what it was written to catch. Database failures get the same responses as before.create(), webhook interception\Throwablelogs(), object lookup\ExceptionObject not foundvectorizeBatch()\ThrowableInternal server errorgetObjectVectorizationStats()\ThrowableInternal server errorvalidate()\ExceptionChoices worth a look
ObjectSourceErrorMiddlewareanswersDbalObjectSourceExceptionandDbalWriteExceptionwith their own 4xx or 5xx status. A wider catch would have turned a source outage intoObject not found, sologs(),validate()and both vectorization routes rethrow those two.validate()stays on\Exception. Its answer holds the failure's message, and anError's text carries internals. AnErrorstays with the server there.logs()logged nothing. Those failures used to reach Nextcloud's log by leaving the route, so catching them silently would lose them. A plainDoesNotExistExceptioninlogs()is not logged. Database failures on these routes now log too; their responses do not change.Failed to read ZIP file contentnow throwsRuntimeException, caught by the same\Exceptionblock, so that answer does not change.For a reviewer to decide
validate()now puts any\Exceptionmessage in the 500 body, where it used to do that for database failures only. It is the response that block was written to give, and the route needs a login, but a message can name internals. A generic answer like the vectorization routes would be a small follow-up.The pins from #5856
testOtherFailuresLeaveTheRoutesrecorded the old behaviour for three routes and is replaced by a test per route. The golden fixture gains only the new log lines on its failure cases; no recorded answer changed.testLogsThrowsWhenFindFailsaccepted either outcome, so it could not fail; it now asserts the 404.testCreateContinuesWhenWebhookFailsruns a database failure, another exception and anError.Verified
ObjectsController: 1207 tests, 0 failures under pcov.SourcesControlleralso importsOCP\DB\Exception, but has no barecatch (Exception), so it was left alone.Full suite
Full PHPUnit under pcov with
--fail-on-riskythrough heavy.sh, on combinedb193646ed(#5879, #5882, #5883 and #5887 on development47f5021b9): 34640 tests, 1 failure, 34 risky. The failure is inherited:CalculationEvaluatorGoldenTestrecords a literal tomorrow fordateAdd bad date, so it goes red on any later day, and this tree touches no calculation file. The 34 risky are the 18 inherited plus 16 inObjectsControllerGeoRoutesGoldenTest, also on development.🤖 Generated with Claude Code