fix: use correct rule ID format and deployment values for chunked site deployments#12265
fix: use correct rule ID format and deployment values for chunked site deployments#12265DEADSERPENT wants to merge 2 commits into
Conversation
Greptile SummaryThis PR fixes two bugs in the chunked site deployment upload path in
Confidence Score: 5/5Safe to merge — both fixes are narrow, well-targeted corrections that bring the chunked upload path into parity with the already-correct single-chunk path. The two fixes are straightforward: one corrects a hardcoded md5($domain) that ignored the environment-configured format, and the other removes an unnecessary indirection through $site->getAttribute(). Both changes are directly validated against the existing single-chunk code path in the same file, and the Functions change is limited to an error message string. No logic regressions were identified. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix: use correct rule ID format and depl..." | Re-trigger Greptile |
What does this PR do?
Fixes inconsistencies in the chunked site deployment upload flow in:
src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.phpFix 1 — Correct rule ID format handling
The single-chunk upload flow already respects
_APP_RULES_FORMATby conditionally using either:md5($domain)(legacy format)ID::unique()(current format)However, the chunked upload path was hardcoded to always use
md5($domain), causing large/chunked site deployments to incorrectly generate legacy-format rule IDs regardless of environment configuration.This PR updates the chunked upload flow to use the same
$isMd5logic as the single-chunk implementation.Fix 2 — Consistent deployment value usage
The chunked upload flow updated site attributes using:
$site->getAttribute(...)immediately after setting those attributes from the deployment object.
The equivalent single-chunk flow directly used deployment values instead.
This PR aligns the chunked upload flow with the existing single-chunk implementation by using deployment values directly for consistency and clarity.
Test Plan
_APP_RULES_FORMATRelated PRs and Issues
Checklist