Skip to content

feat: PHP SDK update for version 23.1.1#70

Merged
premtsd-code merged 4 commits into
mainfrom
fix-database-policies-archives
May 12, 2026
Merged

feat: PHP SDK update for version 23.1.1#70
premtsd-code merged 4 commits into
mainfrom
fix-database-policies-archives

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

@premtsd-code premtsd-code commented May 12, 2026

This PR updates the PHP SDK to version 23.1.1, regenerated from the Appwrite Cloud spec (cloud branch backup-migration-multitype).

What's Changed

  • Fixed: Database model policies and archives now hydrate as BackupPolicy / BackupArchive instead of Index / Collection
  • Added: bigint create/update APIs for legacy Databases attributes and TablesDB columns
  • Added: OAuth2GooglePrompt / Prompt enums and prompt support on updateOAuth2Google
  • Added: updateDenyCanonicalEmailPolicy / updateDenyDisposableEmailPolicy / updateDenyFreeEmailPolicy Project endpoints
  • Updated: BuildRuntime / Runtime enums
  • Updated: key-list query filters extended with key, resourceType, resourceId, secret

Why the Database fix

The Database response model previously declared policies with the Index schema and archives with the Collection schema. The server therefore serialised backup-policy/archive documents through the wrong shape — empty status strings — which broke Database::from() hydration (IndexStatus::from('') throws), aborting the Appwrite→Appwrite migration database resource report/transfer for any project that has a backup policy.

Version bump (23.1.023.1.1) and changelog included so the release is tag-ready on merge. Supersedes #69.

`Database.policies` was typed `list<Index>` and `archives` `list<Collection>`
— the strict `IndexStatus` enum then threw `Unknown IndexStatus value: ''`
when a Database's serialized `policies` (a backup policy, no `status`) was
parsed, breaking any client reading `database.policies` (e.g. Appwrite→Appwrite
migrations, whose source database listing parses the typed `Database` model).
Matches the corrected `$ref` in the appwrite spec (`backupPolicy`/`backupArchive`).
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 12, 2026

Greptile Summary

This PR is a regenerated SDK bump to version 23.1.1. The headline fix corrects Database model hydration so that policies deserialises into BackupPolicy objects and archives into BackupArchive objects, rather than the wrong Index/Collection types that previously caused IndexStatus::from('') to throw and break Appwrite-to-Appwrite migration for any project with backup policies.

  • Database.php fix: policies and archives now use the correct backing types, resolving the hydration crash.
  • New Project endpoints: updateDenyCanonicalEmailPolicy, updateDenyDisposableEmailPolicy, and updateDenyFreeEmailPolicy added with matching tests.
  • Google OAuth2 prompt: prompt parameter added to updateOAuth2Google; backed by two new enums (Prompt and OAuth2GooglePrompt) that are currently identical in values — this appears to be an artefact of the spec generator emitting separate request/response enum types.

Confidence Score: 5/5

Safe to merge — the core hydration fix is targeted and correct, and all new service methods follow established patterns.

The Database.php hydration fix directly addresses a known crash path and the change is straightforward. All new service methods match the existing OAuth2-update pattern, carry unit tests, and touch no shared state. The duplicated Prompt/OAuth2GooglePrompt enum pair is a cosmetic generator artefact that does not affect runtime correctness.

No files require special attention; OAuth2GooglePrompt.php and Prompt.php are worth a second glance to confirm the generator intent around the duplicate enum pair.

Important Files Changed

Filename Overview
src/Appwrite/Models/Database.php Core bug fix: policies now hydrates as BackupPolicy and archives as BackupArchive, resolving the broken hydration that caused IndexStatus::from('') to throw on any project with backup policies
src/Appwrite/Enums/OAuth2GooglePrompt.php New enum for Google OAuth2 prompt values; functionally identical to the also-new Prompt enum — same three cases, same string values
src/Appwrite/Enums/Prompt.php New generic Prompt enum imported by Project service and used in docs; identical in values to OAuth2GooglePrompt, leading to a duplicate-enum situation from code generation
src/Appwrite/Models/OAuth2Google.php Added prompt field (array of OAuth2GooglePrompt); hydration and serialization follow existing patterns correctly
src/Appwrite/Services/Project.php Added updateOAuth2Google prompt parameter and three new deny-email-policy methods; all follow established service patterns with correct HTTP methods and return types
src/Appwrite/Client.php Version bump from 23.1.0 to 23.1.1 in user-agent, SDK version header, and package metadata
tests/Appwrite/Services/ProjectTest.php New test methods cover updateOAuth2Google (with prompt array), and all three deny-email-policy endpoints; fixture data matches expected response shapes

Reviews (3): Last reviewed commit: "docs: expand 23.1.1 changelog with full ..." | Re-trigger Greptile

@premtsd-code premtsd-code changed the title fix: Database.policies/archives use BackupPolicy/BackupArchive models feat: PHP SDK update for version 23.1.1 May 12, 2026
@premtsd-code premtsd-code merged commit fd7c0f0 into main May 12, 2026
1 check passed
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.

2 participants