Skip to content

feat: Flutter SDK update for version 24.1.1#311

Merged
abnegate merged 4 commits into
mainfrom
dev
May 19, 2026
Merged

feat: Flutter SDK update for version 24.1.1#311
abnegate merged 4 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 19, 2026

This PR contains updates to the Flutter SDK for version 24.1.1.

What's Changed

  • Fixed: Removed Advisor service and Insight, InsightCTA, InsightList, Report, ReportList models (admin-only endpoints, not intended for client SDKs)
  • Added: sizeActual field to File model
  • Updated: Refreshed code formatting from the SDK generator

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR bumps the Flutter SDK to version 24.1.1, removing the admin-only Advisor service and its five associated models (Insight, InsightCTA, InsightList, Report, ReportList), and adds a sizeActual field to the File model.

  • All five Advisor model files, the service file, its docs examples, and its tests are cleanly deleted with no dangling references left in lib/appwrite.dart or lib/models.dart.
  • sizeActual is added as a required int field on File and is wired into fromMap, toMap, the constructor, and every test fixture — but the fromMap assignment uses a bare map lookup (map['sizeActual']) without a null-safe fallback, consistent with other int fields in the same class yet fragile against older server responses.
  • Version strings are consistently updated to 24.1.1 across pubspec.yaml, README.md, client_browser.dart, and client_io.dart.

Confidence Score: 4/5

Safe to merge; the Advisor removal is clean and the version bump is consistent, but sizeActual in File.fromMap will throw on any server response that omits the field.

The Advisor removal is thorough — all files, exports, docs, and tests are deleted with no dangling references. The version bump is consistent across all four files that carry it. The only concern is sizeActual: map['sizeActual'] in File.fromMap: map['sizeActual'] returns null when the key is absent, and assigning that to a non-nullable int field throws at runtime for any client talking to a server build predating this field. Every storage API call that returns a File object would crash on such a server.

lib/src/models/file.dart — the new sizeActual field in fromMap needs a null-safe default (e.g. ?? 0) to avoid a runtime crash on older server responses.

Important Files Changed

Filename Overview
lib/src/models/file.dart Adds sizeActual (non-nullable int) field; parsed from map without a null-safe default, matching the existing pattern for other int fields but introducing the same fragility for this new field.
lib/services/advisor.dart Deleted entirely — admin-only Advisor service correctly removed from the client SDK.
lib/appwrite.dart Removes the part 'services/advisor.dart' directive; consistent with the service deletion.
lib/models.dart Removes all five Advisor-related model part directives; clean and consistent with model file deletions.
pubspec.yaml Version bumped from 24.1.0 to 24.1.1; consistent with all other version references updated in the PR.
test/services/storage_test.dart Adds sizeActual to all three storage test fixtures; matches the new required field added to the File model.
lib/src/client_browser.dart SDK version header updated to 24.1.1; routine version bump.
lib/src/client_io.dart SDK version header updated to 24.1.1; routine version bump.

Reviews (2): Last reviewed commit: "Commit from GitHub Actions (Format and p..." | Re-trigger Greptile

Comment thread lib/src/models/file.dart
signature: map['signature'].toString(),
mimeType: map['mimeType'].toString(),
sizeOriginal: map['sizeOriginal'],
sizeActual: map['sizeActual'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 sizeActual is a new required field but is parsed without a null-safe fallback. If an Appwrite server omits this key (e.g., a backend version that predates this field), map['sizeActual'] returns null, which gets passed to a non-nullable int, throwing a Null check operator used on a null value at runtime on every storage file fetch. Adding a ?? 0 default (matching the pattern used for $permissions) prevents this crash.

Suggested change
sizeActual: map['sizeActual'],
sizeActual: map['sizeActual'] ?? 0,

@abnegate abnegate merged commit 6a1d8c8 into main May 19, 2026
1 check 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.

2 participants