Skip to content

Latest commit

 

History

History
82 lines (64 loc) · 3.23 KB

File metadata and controls

82 lines (64 loc) · 3.23 KB

MANUAL QA GUIDE: FLOW

This guide covers the verification of high-stakes safety features (Escalations, Vibe Checks) that require server-side time manipulation.


🧪 SCENARIO 1: The "2-Hour" Vibe Check

Goal: Verify the server detects you are late and allows a peer to send a "Wave".

  1. Set the Stage:
    • Open the app and ensure you are logged in.
    • Note your Rhythm time (e.g., 8:00 PM).
  2. Time Travel (SQL): Run this in the Supabase SQL Editor to make the server think you missed your deadline 3 hours ago:
    UPDATE profiles 
    SET schedule_time = (NOW() AT TIME ZONE 'Asia/Kolkata' - INTERVAL '3 hours')::time 
    WHERE display_name = 'Alex';
    
    -- Ensure no check-in exists for today
    DELETE FROM checkins WHERE user_id = (SELECT id FROM profiles WHERE display_name = 'Alex');
  3. Trigger: Wait for the next hourly Cron job or manually trigger the heartbeat function via CLI/Curl.
  4. Verification:
    • Check vibe_checks table for a new entry.
    • Verify you receive a Push Notification: "A Flow Mate sent a wave."

🧪 SCENARIO 2: The "24-Hour" System Warning

Goal: Verify the system sends a serious warning after 24h of silence.

  1. Time Travel (SQL): Make the server think your last check-in was 25 hours ago:
    DELETE FROM checkins WHERE user_id = (SELECT id FROM profiles WHERE display_name = 'Alex');
    INSERT INTO checkins (user_id, timestamp, mood) 
    VALUES ((SELECT id FROM profiles WHERE display_name = 'Alex'), NOW() - INTERVAL '25 hours', 'flowing');
  2. Trigger: Run the heartbeat function.
  3. Verification:
    • Receive Push Notification: "Alex, everything okay? We haven't heard from you in 24h."

🧪 SCENARIO 3: The "48-Hour" Final Escalation (SMS)

Goal: Verify your Anchor (Mom/Guardian) receives a real SMS when you go missing.

  1. Time Travel (SQL): Make the server think you've been silent for 49 hours:
    DELETE FROM checkins WHERE user_id = (SELECT id FROM profiles WHERE display_name = 'Alex');
    INSERT INTO checkins (user_id, timestamp, mood) 
    VALUES ((SELECT id FROM profiles WHERE display_name = 'Alex'), NOW() - INTERVAL '49 hours', 'flowing');
  2. Trigger: Run the heartbeat function.
  3. Verification:
    • CRITICAL: Check the phone of your Anchor Contact. They should receive an SMS from your Twilio number.
    • Check profiles table: last_escalated_at should now be populated with the current timestamp.

🧪 SCENARIO 4: Silent Sync (Hardware Swap)

Goal: Verify the app heals its own data when moving to a new phone.

  1. Simulate Corruption: Manually set your token to NULL in the DB:
    UPDATE profiles SET fcm_token = NULL, timezone = 'UTC' WHERE display_name = 'Alex';
  2. Action: Close and re-open the app on your iPhone.
  3. Verification:
    • Refresh the DB. fcm_token should be restored and timezone should be 'Asia/Kolkata'.

🛠️ USEFUL COMMANDS

Trigger Heartbeat Manually (Staging):

curl -X POST "https://ozbkjlxoajwjqmwgrfet.supabase.co/functions/v1/heartbeat" \
-H "Authorization: Bearer YOUR_SERVICE_ROLE_KEY" \
-H "Content-Type: application/json" \
-d '{}'