Repository navigation
chore(abuse): require appwrite/appwrite ^32.2.0 (appwrite:appwrite:alert#4723 follow-up) - #15474
Conversation
This repository runs packages/abuse against SDK 32.2.0 (the root composer.lock pin), while the package manifest still allowed only ^27.1, so anyone installing utopia-php/abuse from Packagist resolved a generation behind the one appwrite exercises. The adapter's calls are unchanged across the two: the TablesDB service, Query, ID, TablesDBIndexType and the Row model all keep the signatures TimeLimit\Appwrite\TablesDB uses, and the SDK's tightened requirements (PHP >=8.5, psr/http-client ^1.0, utopia-php/client ^0.6) are ones abuse already carries. The recording-client cases added here pin the requests setup() makes, and pass on both 27.1.0 and 32.2.0. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Review complete. No issues found — approved ✅. This PR upgrades the SDK the abuse package's TablesDB adapter runs against from appwrite/appwrite 27.1 to 32.2, and locks that contract down with tests. The CHANGELOG records the new dependency floor, the no-redirect client behavior, and the wire-compatibility of the adapter's calls across both SDK versions. The composer constraint move matches the lockfile and sibling package constraints, so no manifest inconsistency exists.
Reviewed commit: b51157c |
🟢 Tier S · Ready to merge
The abuse package now requires the Appwrite PHP SDK generation used by the monorepo. Recording-client tests cover the TablesDB setup requests for a new table and for recovery of an existing table, and the changelog describes the dependency and transport changes.
📂 Walkthrough · 4
Reviewed |
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
chore(abuse): require appwrite/appwrite ^32.2.0 (appwrite:appwrite:alert#4723 follow-up) (cherry picked from commit 69d9539)
What does this PR do?
Follow-up to #15404 (code-scanning alert appwrite:appwrite:alert#4723) landing in the dependency
packages/abusetracks, reviewed for anything the package has to adapt to.That fix is entirely server-side:
Devices/Create.phpresolves its adoption target through$user->sessionVerify()on the secret in the request store instead of consuming thesessionresource, plus a docblock on that resource and a JWT case inAccountDevicesCustomClientTest. Noappwrite/appwriteSDK class, no API spec, and nothing underpackages/abuse—TimeLimit\Appwrite\TablesDBonly ever touches theTablesDBservice with an API key. There is no API change here to adapt to.What the review did turn up is that the package manifest has drifted from the SDK this repository actually runs it against. The root
composer.lockpinsappwrite/appwrite32.2.0, whilepackages/abuse/composer.jsonstill allowed only^27.1. Inside the monorepo the constraint is inert (the rootreplacesutopia-php/abuse), so CI has been exercising the adapter against 32.2 the whole time — but anyone installingutopia-php/abusefrom Packagist resolved 27.x, a generation behind, with nothing in the suite pinning the two to the same behaviour.This raises the constraint to
^32.2.0and adds the coverage that makes the move checkable.The adapter needs no code change for it. Everything it calls keeps its signature between 27.1.0 and 32.2.0 —
create,createTable,getTable,createRow,updateRow,listRows,deleteRows,increment/decrementRowColumn, the three per-type column endpoints,createIndex,listColumns,listIndexes,Query,ID,TablesDBIndexType(still aJsonSerializablevalue class withUNIQUE()/KEY()/from(), not a native enum) andRowwith itsid/toArray(). 32.2 appends optionaldescriptionparameters, encodes path segments and rejects empty ids, none of which the adapter passes or relies on. The SDK's tightened requirements — PHP>=8.5,psr/http-client^1.0,utopia-php/client^0.6— are ones abuse already declares.One behaviour change is worth recording for consumers, and the CHANGELOG now does: the 32.x client no longer follows redirects (27.1 set
CURLOPT_FOLLOWLOCATIONfor every non-locationresponse type), so anAPPWRITE_ENDPOINTthat redirects fails the call instead of being followed with the API key attached.Test Plan
New recording-client cases in
packages/abuse/tests/TablesDBTest.php, backed by aSetupTablesDBClientthat answers the requestssetup()makes, so the schema the adapter asks the SDK for can be read off the wire without a backend:testSetupCreatesTheColumnsAndIndexesWithTheTable— the table is created with its columns and indexes inline, and nothing is created one by one or polled.testSetupRepairsATableLeftBehindByAnEarlierRun— a table left behind by a half-finished setup is repaired through the per-type column endpoints with the same schema, its index types round tripping throughTablesDBIndexType.Run standalone against each SDK generation in
php:8.5-cli-alpine(the package's unit suite, so the recording cases are what distinguishes them):appwrite/appwrite32.2.0 —OK (49 tests, 160 assertions)appwrite/appwrite27.1.0 —OK (49 tests, 160 assertions)Identical results are the point: the same requests go out on both, so the constraint move is a declaration catching up, not a behaviour change.
Also on 32.2.0:
tests/E2E/Appwrite/TablesDBFixtureTestandtests/E2E/DiscoveryTest—OK (9 tests, 81 assertions). The fixture test drives the real SDK over HTTP against a PHP built-in server, so the 32.x transport (utopia-php/clientinstead of raw cURL) is exercised end to end, not just mocked.phpstanat the package'slevel: max—No errors;rector --dry-run—Rector is done!;pint --teston the touched files —pass.The root
composer.lockis untouched: the root already requires^32.2.0andreplacesutopia-php/abuse, so this manifest edit cannot move the monorepo's resolution.Related PRs and Issues
Checklist
packages/abuseis a library with no routes or specs.🤖 Generated with Claude Code