You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `appflowy` branch (28 commits, 251 commits behind master) contained password management features. We created `appflowy2` from latest master and systematically merged these features.
11
+
This doc covers two migrations:
12
12
13
-
**Result:**`appflowy2` = master (latest) + appflowy features (11 commits) + tests (21 new tests)
13
+
1.**appflowy → appflowy2** (Nov 2025): Original fork rebuilt on top of latest master.
14
+
2.**appflowy2 → appflowy3** (Apr 2026): Re-synced with 5 months of upstream changes (~98 commits, including passkeys, custom OAuth providers, OAuth state refactor, and dependency bumps).
15
+
16
+
**Current working branch:**`fix-apple-login` (branched from `appflowy3`, carries the Apple OAuth hotfix + this doc update).
17
+
**Stable integration branch:**`appflowy3` = `appflowy2` + upstream master up to `7337e21` (2026-04-02).
: master adds passkeys, custom OAuth, OAuth state refactor
54
+
: appflowy2 stays pinned to Nov 2025 master
55
+
56
+
Apr 4, 2026 : appflowy3 Re-sync
57
+
: Branched from appflowy2
58
+
: Merged master up to 7337e21 (~98 upstream commits)
59
+
: Hotfix: Apple login (context regression)
35
60
```
36
61
37
62
---
@@ -192,14 +217,111 @@ See `TESTING_GUIDE.md` for details.
192
217
193
218
---
194
219
220
+
## appflowy3 — Upstream Re-sync (Apr 2026)
221
+
222
+
### Why
223
+
224
+
By April 2026, `master` had moved ~5 months past `appflowy2`. Upstream added substantial security and feature work (passkeys, custom OAuth providers, OAuth state refactor, dependency bumps for CVEs) that we wanted without losing AppFlowy's password-management features. Rather than abandon appflowy2 or cherry-pick selectively, we merged master into appflowy2 via a dedicated branch.
| Commit | What it changes | Why it matters to us |
270
+
|---|---|---|
271
+
|`53021f6`|`feat: support custom oauth & oidc providers`| New `custom:` provider type, admin endpoints |
272
+
|`645654d`|`feat: replace JWT OAuth state with flow_state.id UUID`| OAuth callback state is now a UUID; legacy JWT fallback removed by `f1fabc4`|
273
+
|`40d07b5`|`feat: cache OIDC discovery documents`| Apple/Google/Azure now go through `OIDCProviderCache`|
274
+
|`7f36eb0`|`feat(oauth): X/Twitter v2 provider`| Changed `GetOAuthToken(code)` → `GetOAuthToken(ctx, code, opts...)` signature across **all** providers — root cause of the Apple regression below |
275
+
|`6f0b2eb`|`fix: add MaxBytesReader middleware`| Global 1MB request body cap |
276
+
|`e8f679b`|`feat: Sb-Forwarded-For header`| New trust-proxy path for client IP |
277
+
|`058836f`|`chore: update Go v1.23.7 → v1.25.5`| Go toolchain bump |
|**Apple login fails with `Unable to exchange external code`**| ✅ Fixed on `fix-apple-login` branch |`internal/api/provider/apple.go:127` — restored `context.Background()` for the Exchange call. The new signature passes the request context, which is bound to the 10s `GOTRUE_API_MAX_REQUEST_DURATION` timeout and kills Apple's token exchange |
285
+
|`cmd/migrate_cmd.go:83` uses `fmt.Sprintf` without importing `fmt`| ⚠️ Open | Pre-existing on this branch; `go build ./...` fails. One-line import fix |
286
+
287
+
### Apple login fix — detail
288
+
289
+
`commit 7f36eb0` (X/Twitter v2 provider) changed every provider's `GetOAuthToken` to accept and use the request context. For Apple this means the token exchange is subject to the global 10s request timeout. Combined with the library bump `golang.org/x/oauth2 0.17 → 0.34` — which tightened token-exchange HTTP behavior — Apple's `/auth/token` call started failing consistently.
290
+
291
+
The fix keeps the new signature (required by the `OAuthProvider` interface) but uses a background context internally for the HTTP call to Apple:
|`fix-apple-login`|**Current working branch.** Branched from appflowy3 with Apple OAuth regression hotfix | ✅ In-flight — merge back into appflowy3 once verified |
0 commit comments