Skip to content

chore(abuse): require appwrite/appwrite ^32.2.0 (appwrite:appwrite:alert#4723 follow-up) - #15474

Merged
ChiragAgg5k merged 1 commit into
mainfrom
chore/abuse-sdk-32
Nov 11, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
chore/abuse-sdk-32

Conversation

@claudear

Copy link
Copy Markdown
Contributor

What does this PR do?

Follow-up to #15404 (code-scanning alert appwrite:appwrite:alert#4723) landing in the dependency packages/abuse tracks, reviewed for anything the package has to adapt to.

That fix is entirely server-side: Devices/Create.php resolves its adoption target through $user->sessionVerify() on the secret in the request store instead of consuming the session resource, plus a docblock on that resource and a JWT case in AccountDevicesCustomClientTest. No appwrite/appwrite SDK class, no API spec, and nothing under packages/abuse — TimeLimit\Appwrite\TablesDB only ever touches the TablesDB service 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.lock pins appwrite/appwrite 32.2.0, while packages/abuse/composer.json still allowed only ^27.1. Inside the monorepo the constraint is inert (the root replaces utopia-php/abuse), so CI has been exercising the adapter against 32.2 the whole time — but anyone installing utopia-php/abuse from 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.0 and 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 a JsonSerializable value class with UNIQUE()/KEY()/from(), not a native enum) and Row with its id/toArray(). 32.2 appends optional description parameters, 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_FOLLOWLOCATION for every non-location response type), so an APPWRITE_ENDPOINT that 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 a SetupTablesDBClient that answers the requests setup() 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 through TablesDBIndexType.

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/appwrite 32.2.0 — OK (49 tests, 160 assertions)
  • appwrite/appwrite 27.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/TablesDBFixtureTest and tests/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/client instead of raw cURL) is exercised end to end, not just mocked.
  • phpstan at the package's level: max — No errors; rector --dry-run — Rector is done!; pint --test on the touched files — pass.

The root composer.lock is untouched: the root already requires ^32.2.0 and replaces utopia-php/abuse, so this manifest edit cannot move the monorepo's resolution.

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs? — no API metadata changes; packages/abuse is a library with no routes or specs.

🤖 Generated with Claude Code

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]>
@luxor-code-review

luxor-code-review Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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.

Files Change
packages/abuse/composer.json Raises the appwrite/appwrite requirement to ^32.2.0.
packages/abuse/CHANGELOG.md Documents the 32.2 dependency floor, the redirect-following removal, and the unchanged TablesDB adapter call surface.
packages/abuse/tests/TablesDBTest.php Adds two cases covering inline columns/indexes at table creation and per-endpoint repair of a half-completed setup, including index-type round trips.
packages/abuse/tests/TimeLimit/SetupTablesDBClient.php New recording fake Appwrite\Client that answers the requests setup() makes and captures them for wire assertions.

Reviewed commit: b51157c

@appwrite

appwrite Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The SDK constraint matches the generation already used by the monorepo, and the added tests exercise both new-table setup and recovery requests.

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.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 4
File Change
packages/abuse/CHANGELOG.md Documents the SDK dependency update, redirect behavior, and added setup tests.
packages/abuse/composer.json Raises the required Appwrite SDK version to ^32.2.0.
packages/abuse/tests/TablesDBTest.php Adds assertions for new-table setup and repair request behavior.
packages/abuse/tests/TimeLimit/SetupTablesDBClient.php Adds a recording client fake to exercise TablesDB setup without a backend.

Reviewed b51157c · Details · Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

6 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (3)
  • php.appwrite.secret-compare-timing (1)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → chore/abuse-sdk-32 (after).

Metric Before After Change
🚀 Requests/sec 178.16 181.75 ⚪ +2%
⏱️ Latency P50 98.59 ms 95.71 ms ⚪ -2.9%
⏱️ Latency P95 224.43 ms 222.48 ms ⚪ -0.9%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 95.71 222.48 11,400 181.75 -1.95
Account 179.56 330.63 600 10.23 +9.4
TablesDB 91.9 170.01 6,200 101.02 -13.77
Storage 91.01 206.76 3,000 50.63 +0.34
Functions 136.24 262.55 1,600 27.73 -2.92

Top API waits (after)

API request Max wait (ms)
account.name.update 501.19
functions.variables.update 453.4
account.prefs.update 425.46
storage.files.create 420.57
functions.delete 414.76

@ChiragAgg5k
ChiragAgg5k merged commit 69d9539 into main Nov 11, 2026
249 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the chore/abuse-sdk-32 branch November 11, 2026 12:04
ChiragAgg5k added a commit that referenced this pull request Nov 12, 2026
chore(abuse): require appwrite/appwrite ^32.2.0 (appwrite:appwrite:alert#4723 follow-up)

(cherry picked from commit 69d9539)
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.

3 participants