Repository navigation
fix(console): accept null from nullable SDK model fields - #14693
Conversation
appwrite/sdk-generator 5.7.3 types nullable model properties as `T | null`, and 5.13.0 landed on main in 47e8aa1. Any preview Console SDK built with `bun run sdk:preview` now carries those types, so a PR that pins one fails `lint:types` with errors across billing, analytics, databases and usage. Widen the console helpers that take these fields to accept null, coalesce at the few boundaries that map into local shapes, and skip usage points without a time. Type-checks cleanly against both 19.1.0-rc.1 and a 5.13.0 preview; the baseline shrinks by 15 errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review complete. No issues found — approved ✅. The change is a type-level nullability migration: SDK-generated model fields that may arrive as
Reviewed commit: f7c5501 |
New ConsoleProject ID: Tip Messaging handles push notifications, emails, and SMS through one unified API |
🟢 Tier S · Ready to mergeThe Console now accepts nullable SDK model fields across billing, analytics, database, messaging, and plan helpers, coalescing nullable values when mapping into local shapes. Usage aggregation skips points without timestamps, site creation uses an SDK-derived parameter type, and the type-error baseline drops resolved entries.
📂 Walkthrough · 15
Reviewed |

What
Console code now type-checks against Console SDKs that type nullable model fields as
T | null.appwrite/sdk-generator5.7.3 started emittingT | nullfor nullable model properties (appwrite/sdk-generator#2023). Main picked up 5.13.0 in 47e8aa1, so every preview SDK frombun run sdk:previewnow has 387| nullfields that the pinned19.1.0-rc.1doesn't. A PR that pins one of these builds, asapps/console/AGENTS.mdasks, failslint:typeswith 89 errors in 40 files that have nothing to do with the PR. #14351 is the first PR to hit it. The next Console SDK release built with the new generator would hit the same errors.null: payment method summaries and the brand avatar, plan records and location-gated plans, downgrade target plans, dedicated database link inputs and engine matchers, impersonation checks, MCP OAuth token sets, analytics trend and traffic helpers, function schedule mode, message schedule defaults, backup size formatting, and the create-databasebackupsEnabledprops.?? undefined: domain price quotes and dedicated database ports.time. Before, they were keyed underundefinedor parsed toNaN.sites.createtakes typed params instead ofas unknown, following the pattern ofSiteUpdateParams.types-baseline.jsondrops 15 errors these changes fix.Verification
@appwrite.io/[email protected],lint:typesreports 1,806 known errors and no new ones.pkg.pr.new/.../@appwrite.io/console@79eecfa) installed,lint:typesreports no new errors. The only failure is 17 errors inreact-query/hooks/databases.tsthat disappear because the nullable request types accept them. A PR on a preview runslint:types --updateto drop them.bun run test:unit: 611 pass.Unblocks #14351.
🤖 Generated with Claude Code