Skip to content

Troubleshooting

Dharanesh V edited this page Oct 4, 2026 · 2 revisions

Google login

Symptom Real cause Fix
Google shows Error 400: redirect_uri_mismatch The Supabase callback URL is missing or differs in Google Cloud Copy the callback URL from the Supabase Google provider page into Google's Authorized redirect URIs, character for character
Google shows Access blocked: app not verified or 403 access_denied Consent screen is in Testing and your account is not a test user Add the account as a test user, or publish the app
Login finishes but lands on localhost or the wrong page redirectTo is not on Supabase's allow-list, so Supabase fell back to the Site URL Add the URL (or a /** wildcard) under Redirect URLs and set the Site URL to production
Mobile: browser never returns to the app Scheme/host mismatch between Dart, manifest/plist and Supabase, or an underscore in the scheme Make all three identical and use hyphens, not underscores
Login works but no startup sync after reload Only signedIn is handled, but web reload fires initialSession Handle AuthChangeEvent.initialSession in the auth listener

Database

Symptom Real cause Fix
Insert/upsert fails with new row violates row-level security policy Missing insert/update policy, or User_id does not equal auth.uid() Check the four policies, and make sure the app sends the logged-in user's id
Select returns an empty list although rows exist RLS is on and the select policy is missing, or you are not authenticated Add the select policy and confirm currentUser != null
column "task_id" does not exist Column was created without quotes, so it became lowercase Recreate the column with the quoted name "Task_id"
Realtime INSERT/UPDATE work but DELETE does not Table lacks replica identity full or is not in the publication Run both statements in the Realtime section of the database page
App crashes on a DELETE event fromSupabaseMap called on a payload with null fields Read oldRecord['Task_id'] as String? directly
Realtime events never arrive .subscribe() not called, or table not published Call .subscribe() and check Database → Publications

Sync behaviour

Symptom Likely cause
Tasks vanish after pull pullTasksFromSupabase deletes local tasks that are missing remotely, which includes tasks not yet synced. Only delete locally if isSynced == true.
Local edit overwritten by older server copy Updated_at is stored without a time zone, so comparisons are skewed. Use UTC timestamps (see database page).
Sync "succeeds" but nothing changes _syncTask returns silently when currentUser == null. Check login state first.

Debug tools

  • Supabase → Logs → Auth shows each login attempt and its error.
  • Supabase → Logs → Postgres shows RLS rejections.
  • Browser DevTools → Network: filter by supabase.co to see the exact request, status code and response body.
  • Run flutter analyze before each commit.

Clone this wiki locally