Skip to content

fix: Fix DI services returning null in app containers - #64563

Merged
susnux merged 1 commit into
masterfrom
fix/fix-di-services-returning-null
Sep 20, 2026
Merged

susnux merged 1 commit into
masterfrom
fix/fix-di-services-returning-null

Conversation

@come-nc

@come-nc come-nc commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

The commit 41d9aa8 broke things, because null is a valid value to be returned by the container so we cannot use it as a special value.
This is an attempt to fix this.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@come-nc
come-nc requested a review from kesselb September 19, 2026 12:13
@come-nc come-nc self-assigned this Sep 19, 2026
@come-nc come-nc added the 2. developing Work in progress label Sep 19, 2026
@come-nc
come-nc force-pushed the fix/fix-di-services-returning-null branch from 9a9ce35 to cbab647 Compare September 19, 2026 12:48
@come-nc come-nc changed the title fix: Revert "fix: Avoid using an exception for a normal fallback situation" fix: Fix DI services returning null in app containers Sep 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Possible performance regression detected

Show Output
7 queries added

= /remote.php/dav/files/test
= /remote.php/dav/files/test/test.txt
= /remote.php/dav/files/test/many_files
= /remote.php/dav/files/test/new_file.txt
≠ /remote.php/dav/files/test/new_file.txt with 7 queries added
  - UPDATE "oc_filecache" SET "size" = :dcValue4 WHERE ("fileid" = :dcValue1) AND ("storage" = :dcValue2) AND (("size" <> :dcValue3) OR ("size" IS NULL))
  - UPDATE "oc_filecache" SET "size" = :dcValue4 WHERE ("fileid" = :dcValue1) AND ("storage" = :dcValue2) AND (("size" <> :dcValue3) OR ("size" IS NULL))
  - SELECT "path" FROM "oc_filecache" WHERE ("storage" = :dcValue1) AND ("fileid" = :dcValue2)
  - SELECT "path" FROM "oc_filecache" WHERE ("storage" = :dcValue1) AND ("fileid" = :dcValue2)
  + SELECT "storage", "path", "mimetype" FROM "oc_filecache" WHERE "fileid" = :dcValue1
  + SELECT "storage_id", "root_id", "user_id", "mount_point", "mount_id", "f"."path", "mount_provider_class" FROM "oc_mounts" "m" INNER JOIN "oc_filecache" "f" ON "m"."root_id" = "f"."fileid" WHERE ("m"."storage_id" = :dcValue1) AND ("f"."storage" = :dcValue2) AND (("f"."fileid" = :dcValue3) OR ("f"."path" = '') OR (("f"."path" || :dcValue4) = SUBSTR(:dcValue5, :dcValue6, LENGTH("f"."path") + :dcValue7))) AND ("user_id" = :dcValue8)
  + SELECT "filecache"."fileid", "storage", "path", "path_hash", "filecache"."parent", "filecache"."name", "mimetype", "mimepart", "size", "mtime", "storage_mtime", "encrypted", "filecache"."etag", "filecache"."permissions", "checksum", "unencrypted_size", "metadata_etag", "creation_time", "upload_time", "meta"."json" AS "meta_json", "meta"."sync_token" AS "meta_sync_token" FROM "oc_filecache" "filecache" LEFT JOIN "oc_filecache_extended" "fe" ON "filecache"."fileid" = "fe"."fileid" LEFT JOIN "oc_files_metadata" "meta" ON "filecache"."fileid" = "meta"."file_id" WHERE ("filecache"."fileid" = :dcValue1) AND ("storage" = :dcValue2)
  + DELETE FROM "oc_filecache" WHERE ("storage" = :dcValue1) AND ("fileid" = :dcValue2)
  + DELETE FROM "oc_filecache_extended" WHERE "fileid" = :dcValue1
  + SELECT "file_id", "json", "sync_token" FROM "oc_files_metadata" WHERE "file_id" IN (:dcValue1)
  + DELETE FROM "oc_files_metadata" WHERE "file_id" IN (:dcValue1)
  + DELETE FROM "oc_files_metadata_index" WHERE "file_id" IN (:dcValue1)
  + SELECT "fileid" FROM "oc_filecache" WHERE ("storage" = :dcValue1) AND ("path_hash" = :dcValue2)
  + UPDATE "oc_file_locks" SET "lock" = :dcValue1, "ttl" = :dcValue2 WHERE ("key" = :dcValue3) AND ("lock" = :dcValue4)
  + SELECT "filecache"."fileid", "storage", "path", "path_hash", "filecache"."parent", "filecache"."name", "mimetype", "mimepart", "size", "mtime", "storage_mtime", "encrypted", "filecache"."etag", "filecache"."permissions", "checksum", "unencrypted_size", "metadata_etag", "creation_time", "upload_time", "meta"."json" AS "meta_json", "meta"."sync_token" AS "meta_sync_token" FROM "oc_filecache" "filecache" LEFT JOIN "oc_filecache_extended" "fe" ON "filecache"."fileid" = "fe"."fileid" LEFT JOIN "oc_files_metadata" "meta" ON "filecache"."fileid" = "meta"."file_id" WHERE ("path_hash" = :dcValue1) AND ("storage" = :dcValue2)
= ./occ profiler:list

… instead

The switch from Exception to null as fallback value broke legitimate
 uses, so instead simplify the code and inline the query.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
come-nc force-pushed the fix/fix-di-services-returning-null branch from cbab647 to 7e3909b Compare September 19, 2026 12:50
@come-nc
come-nc marked this pull request as ready for review September 19, 2026 13:41
@come-nc
come-nc requested a review from a team as a code owner September 19, 2026 13:41
@come-nc
come-nc requested review from Altahrim, icewind1991, leftybournes and salmart-dev and removed request for a team September 19, 2026 13:41
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 19, 2026
@come-nc

come-nc commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Possible performance regression detected

I think that’s a false-positive, I rerun the job and it did not comment again.

@susnux
susnux merged commit 696e66b into master Sep 20, 2026
166 of 172 checks passed
@susnux
susnux deleted the fix/fix-di-services-returning-null branch September 20, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants