Skip to content

Fix createSession error handling to throw errors instead of returning fallback codes#3

Open
dillonvargo wants to merge 1 commit into
mainfrom
devin/1757630444-fix-session-creation-fallback
Open

Fix createSession error handling to throw errors instead of returning fallback codes#3
dillonvargo wants to merge 1 commit into
mainfrom
devin/1757630444-fix-session-creation-fallback

Conversation

@dillonvargo

Copy link
Copy Markdown
Owner

Fix createSession error handling to throw errors instead of returning fallback codes

Summary

Fixed a critical issue in the createSession function where it would return a random fallback code even when session storage completely failed. This could lead to users thinking they successfully created a session when the data wasn't actually stored anywhere.

Key changes:

  • Added session storage validation to ensure sessions are only considered successful when actually stored
  • Changed error handling from returning random fallback codes to throwing proper errors
  • Maintains dual storage approach (localStorage + window.matchMunchSessions fallback)

Review & Testing Checklist for Human

Risk Level: 🟡 Medium - Behavior change in error handling that needs end-to-end verification

  • Test session creation flow end-to-end - Create sessions and verify they work properly, especially when localStorage might be unavailable
  • Test error scenarios - Verify that session creation failures are properly displayed to users and don't result in broken states
  • Verify storage validation logic - Check that the validation correctly identifies when sessions are successfully stored vs. when they fail

Test Plan

  1. Test normal session creation flow (should work unchanged)
  2. Test with localStorage disabled/unavailable (should fall back to memory storage)
  3. Test with both storage methods unavailable (should show proper error to user)
  4. Verify that existing error handling in HomeScreen.js displays appropriate error messages

Notes

…returning fallback codes

- Replace problematic fallback logic that returned random codes on error
- Add session storage validation before returning success codes
- Ensure sessions are only considered created when actually stored
- Maintain compatibility with existing HomeScreen.js error handling

Co-Authored-By: Dillon Vargo <dillonvargo@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify

netlify Bot commented Sep 11, 2025

Copy link
Copy Markdown

Deploy Preview for match-n-munch ready!

Name Link
🔨 Latest commit d7b8593
🔍 Latest deploy log https://app.netlify.com/projects/match-n-munch/deploys/68c35090ba9ca4000833b535
😎 Deploy Preview https://deploy-preview-3--match-n-munch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant