-
Notifications
You must be signed in to change notification settings - Fork 292
fix: add explicit relationship field selection for Appwrite v1.8.0 compatibility #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
fix: add explicit relationship field selection for Appwrite v1.8.0 compatibility #652
Conversation
|
🎉 Welcome @pranjal29092005!
We appreciate your contribution! 🚀 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
lib/controllers/change_email_controller.dart (1)
37-52: LGTM! Ensures complete document retrieval.The addition of
Query.select(["*"])ensures full document data is available. As noted in the PR description, the wildcard selection is used for safety and can be optimized later to select only required fields for existence checks.Future optimization: Since this function only checks email availability via document count, consider selecting minimal fields (e.g., just the email field) instead of all fields to reduce bandwidth:
queries: [ Query.equal('email', changedEmail), - Query.select(["*"]), + Query.select(["email"]), ],lib/controllers/auth_state_controller.dart (1)
349-358: LGTM! Comprehensive fix applied across all queries.All database queries in this file now explicitly request full document data. As noted in the PR description, the wildcard
["*"]approach is safe for initial compatibility. Consider optimizing to specific field lists in a future iteration to reduce data transfer overhead.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
lib/controllers/auth_state_controller.dart(5 hunks)lib/controllers/change_email_controller.dart(1 hunks)lib/controllers/email_verify_controller.dart(1 hunks)lib/controllers/friend_calling_controller.dart(3 hunks)lib/controllers/friends_controller.dart(1 hunks)lib/controllers/pair_chat_controller.dart(3 hunks)lib/controllers/room_chat_controller.dart(3 hunks)lib/controllers/rooms_controller.dart(3 hunks)lib/controllers/single_room_controller.dart(3 hunks)lib/controllers/user_profile_controller.dart(1 hunks)lib/services/room_service.dart(5 hunks)
🔇 Additional comments (28)
lib/controllers/user_profile_controller.dart (1)
122-127: LGTM! Correctly fetches relationship fields.The addition of
Query.select(["*"])ensures thefollowersrelationship field (accessed at line 130) is properly loaded with Appwrite SDK v20.3.1, addressing the v1.8.0 breaking change.lib/controllers/email_verify_controller.dart (1)
116-124: LGTM! Ensures complete user document retrieval.The addition of
Query.select(["*"])guarantees all fields of the user document are fetched, including any relationship fields that may be needed for verification status checks.lib/controllers/friend_calling_controller.dart (3)
124-130: LGTM! Ensures complete call document retrieval.The addition of
Query.select(["*"])ensures all fields are available forFriendCallModel.fromJson()deserialization at line 130, including any relationship fields.
154-160: LGTM! Ensures complete call document retrieval.The addition of
Query.select(["*"])ensures all fields are available forFriendCallModel.fromJson()deserialization at line 160.
174-181: LGTM! Ensures complete call document retrieval.The addition of
Query.select(["*"])ensures all fields are available forFriendCallModel.fromJson()deserialization at line 181.lib/services/room_service.dart (5)
37-46: LGTM! Ensures complete participant document retrieval.The addition of
Query.select(["*"])ensures all participant fields are available for processing, including any relationship fields that may be present.
68-75: LGTM! Ensures room document includes totalParticipants.The addition of
Query.select(["*"])ensures thetotalParticipantsfield (accessed at line 79) is properly loaded, which is critical for accurate participant count management.
183-191: LGTM! Ensures complete participant document retrieval.The addition of
Query.select(["*"])ensures all participant fields are available for the deletion loop.
227-232: LGTM! Ensures room document includes totalParticipants.The addition of
Query.select(["*"])ensures thetotalParticipantsfield (accessed at line 254) is properly loaded for participant count validation.
235-244: LGTM! Ensures complete participant document retrieval.The addition of
Query.select(["*"])ensures all participant fields are available for counting and deletion operations.lib/controllers/pair_chat_controller.dart (3)
132-138: LGTM! Ensures participant profile data is loaded.The addition of
Query.select(["*"])ensures theprofileImageUrlfield (accessed at line 138) is properly loaded from the user document.
142-149: LGTM! Ensures participant profile data is loaded.The addition of
Query.select(["*"])ensures theprofileImageUrlfield (accessed at line 148) is properly loaded from the user document.
208-221: LGTM! Ensures complete pair request document retrieval.The addition of
Query.select(["*"])ensures all fields are available forResonateUser.fromJson()deserialization at line 230, including any relationship fields.lib/controllers/single_room_controller.dart (3)
67-73: LGTM! Ensures complete user document retrieval.The addition of
Query.select(["*"])ensures all user fields (email, name, profileImageUrl) accessed at lines 77-79 are properly loaded, including any relationship fields.
115-126: LGTM! Ensures complete participant document retrieval.The addition of
Query.select(["*"])ensures all participant fields are available for processing in the loop at line 128, including any relationship fields.
243-251: LGTM! Ensures complete participant document retrieval.The addition of
Query.select(["*"])ensures all participant fields are available when fetching the participant document ID.lib/controllers/room_chat_controller.dart (3)
47-54: LGTM! Ensures complete message document retrieval.The addition of
Query.select(["*"])ensures all message fields are available for processing, including any relationship fields that may be present.
63-69: LGTM! Ensures replyTo relationship data is loaded.The addition of
Query.select(["*"])ensures the replyTo document fields are properly loaded for deserialization at line 69, addressing the Appwrite v1.8.0 relationship loading behavior.
217-223: LGTM! Ensures replyTo relationship data is loaded.The addition of
Query.select(["*"])ensures the replyTo document fields are properly loaded for real-time message updates, addressing the Appwrite v1.8.0 relationship loading behavior.lib/controllers/auth_state_controller.dart (4)
206-211: LGTM! Relationship field loading fix applied correctly.The addition of
Query.select(["*"])ensures thefollowersrelationship field (accessed at line 218) is properly loaded with Appwrite v1.8.0+.
277-286: LGTM! Complete document data retrieval enabled.Adding
Query.select(["*"])alongsideQuery.equalensures subscribed room documents include all fields needed for registration token updates.
300-309: LGTM! Consistent pattern for created rooms.The fix correctly mirrors the subscribed rooms approach, ensuring creator FCM tokens are accessible.
326-335: LGTM! Token removal flow updated correctly.The removal flow correctly applies the same Query.select pattern to access registration tokens.
lib/controllers/rooms_controller.dart (4)
40-48: LGTM! Participant data loading fixed.The addition of
Query.select(["*"])ensures complete participant documents are retrieved for avatar URL extraction (line 57).
51-56: LGTM! User document retrieval enhanced.Adding
Query.select(["*"])ensures participant profile data, including the profileImageUrl, is fully loaded.
83-87: LGTM! Room listing data retrieval corrected.The fix ensures all room fields (totalParticipants, adminUid, tags, etc.) are available when constructing AppwriteRoom objects (lines 61-71).
105-110: LGTM! Single room retrieval fixed.The fix consistently applies the same pattern as
getRooms, ensuring complete room data for single-room queries.lib/controllers/friends_controller.dart (1)
98-103: LGTM! Friends relationship loading restored.The addition of
Query.select(["*"])ensures thefriendsrelationship field (accessed at line 104) is properly loaded, restoring friends list functionality with Appwrite v1.8.0+.
|
Hi @M4dhav 👋 Thank you for maintaining this project! I've submitted this PR as part of the Unstoppable Hackathon (team: Dev Engers) fix: add explicit relationship field selection for Appwrite v1.8.0 compatibility #652 addressing issue #652 Could you please approve the pending workflow when you have a moment? The automated checks are awaiting maintainer approval. I'm available to address any feedback or make changes if needed. Thank you for your time! 🙏 Team Details: Team Name: Dev Engers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"*" operator will not load all fields, please see https://appwrite.io/docs/products/databases/legacy/queries#load-all-relationship-data for correct way to load fields. Also, please fix merge conflicts
|
Ok sir i will surely do that as soon as possible
…On Fri, 19 Dec, 2025, 17:49 Madhav Gupta, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
"*" operator will not load all fields, please see
https://appwrite.io/docs/products/databases/legacy/queries#load-all-relationship-data
for correct way to load fields. Also, please fix merge conflicts
—
Reply to this email directly, view it on GitHub
<#652 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMBOUXOM6EPXMJVNVH3HAID4CPULJAVCNFSM6AAAAACO56BAI6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKOJYGQYDOOBUHA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
|
Tests are failing, please check. Re-request for review when ready |
|
Sure sir i will solve this completey sir
…On Fri, 19 Dec, 2025, 19:03 Madhav Gupta, ***@***.***> wrote:
*M4dhav* left a comment (AOSSIE-Org/Resonate#652)
<#652 (comment)>
Tests are failing, please check. Re-request for review when ready
—
Reply to this email directly, view it on GitHub
<#652 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMBOUXJRVAD5R5QNR44Q5GL4CP5DFAVCNFSM6AAAAACO56BAI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNZVGEYDONZVG4>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
1c82529 to
42055ef
Compare
42055ef to
7447130
Compare
|
sir i have fixed all issue and solved all merged conflict please review it |
🐛 Problem
With Appwrite v1.8.0, relationship fields are no longer fetched by default when querying documents. This breaking change caused the production version of Resonate to fail after upgrading to Appwrite SDK v17.x (currently v20.3.1).
Impact:
Root Cause: All database queries using
databases.listDocuments()anddatabases.getDocument()that access relationship fields were returning incomplete data.💡 Solution
Added
Query.select(["*"])to all database queries that access relationship fields, implementing Appwrite's new opt-in relationship loading mechanism.Example:
📊 Changes Summary
Files Modified: 11
Lines Changed: +43 insertions, -6 deletions
Modified Components:
✅ Testing
Automated
Manual Testing
📚 References
🎯 Future Optimization
Current implementation uses wildcard
["*"]for safety. Future PRs can optimize by selecting specific fields:📝 Verification Steps
For Reviewers:
Query.select(["*"])For Testing:
git checkout fix/appwrite-v1.8-relationship-loading flutter pub get flutter analyze flutter test🔗 Related Issues
Fixes #636
Ready for Review ✅
This PR restores critical functionality broken by Appwrite v1.8.0. The fix is minimal, focused, and follows established patterns.
Summary by CodeRabbit
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.