Skip to content

perf: remove unneeded sort in getFolderContentsById - #60225

Merged
Altahrim merged 2 commits into
masterfrom
remove-cache-order
May 13, 2026
Merged

perf: remove unneeded sort in getFolderContentsById#60225
Altahrim merged 2 commits into
masterfrom
remove-cache-order

Conversation

@icewind1991

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

TODO

  • ...

Checklist

AI (if applicable)

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

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991
icewind1991 marked this pull request as ready for review May 13, 2026 14:30
@icewind1991
icewind1991 requested a review from a team as a code ownerMay 13, 2026 14:30
@icewind1991
icewind1991 requested review from Altahrim, ArtificialOwl, CarlSchwan and leftybournes and removed request for a teamMay 13, 2026 14:30
@icewind1991icewind1991 added this to the Nextcloud 34 milestone May 13, 2026
@icewind1991

Copy link
Copy Markdown
MemberAuthor

/backport to stable33

@Altahrim
Altahrim merged commit 91a4172 into masterMay 13, 2026
259 of 275 checks passed
@Altahrim
Altahrim deleted the remove-cache-order branch May 13, 2026 14:49
@nextcloud-botnextcloud-bot mentioned this pull request May 15, 2026
oleksandr-nc added a commit to cloud-py-api/nc_py_api that referenced this pull request May 16, 2026
Nextcloud server PR nextcloud/server#60225 dropped the implicit `ORDER
BY name ASC` from `Cache::getFolderContentsById`, so the order of
children inside a downloaded zip is now whatever the DB returns and
varies by backend.
On PostgreSQL this breaks test_download_as_zip /
test_download_as_zip_async, which asserted on positional indices.
Rebuild `_test_download_as_zip` around a `{filename: size}` dict and
check membership + sizes instead of positions.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved robustness of ZIP download tests to handle varying file
ordering, ensuring reliable validation of downloaded archive contents.
<!-- review_stack_entry_start -->
[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/cloud-py-api/nc_py_api/pull/429?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Review <review@local>
@nextcloud-botnextcloud-bot mentioned this pull request May 20, 2026
@icewind1991

Copy link
Copy Markdown
MemberAuthor

/backport to stable32

@nextcloud-botnextcloud-bot mentioned this pull request May 27, 2026
oleksandr-nc added a commit to cloud-py-api/nc_py_api that referenced this pull request Jun 2, 2026
## Summary
Remediates **BadHost**
([CVE-2026-48710](GHSA-86qp-5c8j-p5mr)), a
Host-header path-confusion vulnerability in **Starlette ≤ 1.0.0** that
can bypass path-based authorization. The fix lives in **Starlette
1.0.1**.
FastAPI does **not** cap Starlette (even latest `0.136.3` only requires
`starlette>=0.46.0`), so bumping FastAPI alone does not guarantee a
fixed Starlette, and an explicit floor is required. `nc_py_api` also
imports `starlette` directly (`_session.py`,
`ex_app/integration_fastapi.py`), so declaring it is correct regardless.
## Changes
- **`pyproject.toml`**
- add `starlette>=1.0.1` (the BadHost fix)
- raise `fastapi>=0.133` (the first FastAPI release compatible with
Starlette 1.0+)
- **`CHANGELOG.md`**: `0.30.2` section:
- `Security`: the BadHost pin
- `Changed`: `download_directory_as_zip` archive entry order is no
longer guaranteed (server-side, per nextcloud/server#60225)
The version bump (`_version.py` to `0.30.2`) is intentionally
**omitted** here; it lands in the `[publish]` commit on `main` after
merge.
## Compatibility
- Keeps Python `>=3.10` (FastAPI 0.133+ and Starlette 1.x both require
`>=3.10`).
- Verified: under these constraints pip upgrades the vulnerable
Starlette from `1.0.0` to `1.2.1`; `import nc_py_api` succeeds.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsperformance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@icewind1991@Altahrim@skjnldsv