fix: correct type comparison in _updateTaskStatus (Map vs bool)#227
fix: correct type comparison in _updateTaskStatus (Map vs bool)#227Muneerali199 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
updateTaskStatus() returns Future<Map<String, dynamic>> with a 'success' key, not a bool. Comparing the Map directly to 'true' always evaluates false, causing the success SnackBar to never appear and task details to never reload after a status update. - Renamed variable from 'success' to 'result' for clarity - Fixed condition from 'result == true' to 'result["success"] == true' - Show actual error message from result['error'] on failure - Added extra mounted check after the inner await _loadTaskDetails() Fixes AOSSIE-Org#222
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Summary
Fixes #222
Corrects a wrong type comparison in
task_detail_screen.dartwhere the result ofupdateTaskStatus()(which returnsMap<String, dynamic>) was being compared directly totrue(abool). This comparison always evaluates tofalse, silently breaking success feedback.Problem
SupabaseService.updateTaskStatus()returnsFuture<Map<String, dynamic>>with a'success'key, not abool. The original code:Because
Map<String, dynamic> == trueis alwaysfalse, the success path was dead code — users never saw the success message or had the task detail updated after a status change.Fix
Before / After
Before (
flutter analyze):After: zero
equality_check_with_different_typeswarnings on this file.Checklist
flutter analyzerun — warning resolvedSupabaseService.updateTaskStatus()