Skip to content

feat: SDK update for version 22.1.0 - #73

Merged
ChiragAgg5k merged 1 commit into
mainfrom
release/22.1.0
Oct 6, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
release/22.1.0

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 22.1.0.

What's Changed

  • Added: optional state parameter on createOAuth2Token, returned unchanged on the success and failure URLs

This is a patch on top of the previous stable release: it adds only the state parameter from appwrite/appwrite#14157, plus the version bump and changelog. Generated by diffing the sdk-generator output for the specs before and after #14157.

Adds the optional state parameter to createOAuth2Token (appwrite/appwrite#14157).
@ghost

ghost commented Oct 6, 2026

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The new state parameter needs query-value escaping to preserve values containing ampersands.

Adds an optional state argument to Account.createOAuth2Token and passes it to the OAuth redirect request. Updates the SDK version to 22.1.0, the changelog, and the usage example.

Verdict New comments Fixed Still open
✅ Approved 1 0 0
Finding Where
🟡 Escape state as a query value before sending it Sources/Appwrite/Services/Account.swift:2178
Fix with agent prompt
### Issue 1
Sources/Appwrite/Services/Account.swift:2178
**Escape state as a query value before sending it**

A state such as `a&b` will reach the server as `a`, rather than being returned unchanged: `Client.parametersToQueryString` concatenates raw values and encodes the whole query with `.urlHostAllowed`, which leaves `&` unescaped. Please encode individual query values in the serializer so the new argument preserves arbitrary state strings without introducing extra parameters.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 5
File Change
CHANGELOG.md Documents the new OAuth state parameter in the 22.1.0 release.
README.md Updates the Swift Package Manager dependency version to 22.1.0.
Sources/Appwrite/Client.swift Updates the SDK version header to 22.1.0.
Sources/Appwrite/Services/Account.swift Adds the optional state argument and includes it in OAuth redirect parameters.
docs/examples/account/create-o-auth-2-token.md Shows the optional state argument in the OAuth token example.

Reviewed 9fbd4d2 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost 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 A · Looks good to merge. Summary

"success": success,
"failure": failure,
"scopes": scopes,
"state": state,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Escape state as a query value before sending it

A state such as a&b will reach the server as a, rather than being returned unchanged: Client.parametersToQueryString concatenates raw values and encodes the whole query with .urlHostAllowed, which leaves & unescaped. Please encode individual query values in the serializer so the new argument preserves arbitrary state strings without introducing extra parameters.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Sources/Appwrite/Services/Account.swift
Line: 2178

Comment:
**Escape state as a query value before sending it**

A state such as `a&b` will reach the server as `a`, rather than being returned unchanged: `Client.parametersToQueryString` concatenates raw values and encodes the whole query with `.urlHostAllowed`, which leaves `&` unescaped. Please encode individual query values in the serializer so the new argument preserves arbitrary state strings without introducing extra parameters.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

@ChiragAgg5k
ChiragAgg5k merged commit 414405b into main Oct 6, 2026
2 checks 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.

1 participant