Skip to content

Refine startup error handling to avoid false storage disconnect warnings#1164

Open
JackWilb wants to merge 4 commits intodevfrom
disconnected-errors
Open

Refine startup error handling to avoid false storage disconnect warnings#1164
JackWilb wants to merge 4 commits intodevfrom
disconnected-errors

Conversation

@JackWilb
Copy link
Copy Markdown
Contributor

@JackWilb JackWilb commented Mar 20, 2026

Does this PR close any open issues?

Closes #1153

Give a longer description of what this PR addresses and why it's needed

This changes the participant startup flow so we only show Storage Disconnected for real storage-engine failures.

In Shell.tsx, startup metadata collection now safely handles missing browser APIs like screen.orientation instead of throwing. Startup failures are classified from the actual storage engine state, and non-storage failures now seed a normal alert modal rather than incorrectly setting the storage-disconnected flag. In study dev mode, that alert shows the underlying error message; otherwise it stays generic or uses resume-specific copy when a participantId is present.

I also added a small optional initial-alert path to the store and added focused unit tests for the startup helper logic.

Provide pictures/videos of the behavior before and after these changes (optional)

Are there any additional TODOs before this PR is ready to go?

TODOs:

  • Update relevant documentation
  • ...

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 20, 2026

A preview of 0e0510e is uploaded and can be seen here:

https://revisit.dev/study/PR1164

Changes may take a few minutes to propagate.

@JackWilb JackWilb requested a review from Copilot March 30, 2026 03:59
@JackWilb JackWilb marked this pull request as ready for review March 30, 2026 03:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refines the participant startup flow to avoid showing “Storage Disconnected” for non–storage-engine startup errors (e.g., missing browser APIs or resume/participant lookup failures), while still surfacing actionable alerts when appropriate.

Changes:

  • Adds Shell.utils helpers to safely read screen.orientation, classify storage-engine startup failures, and build initial alert-modal state.
  • Extends studyStoreCreator to accept an optional initial alertModal state and introduces a shared AlertModalState type.
  • Updates Shell.tsx to (a) avoid screen.orientation runtime errors and (b) seed a normal alert modal for non-storage failures; adds focused unit tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/store/types.ts Introduces AlertModalState type alias and uses it in StoreState.
src/store/store.tsx Adds optional initialAlertModal parameter to seed initial store state; tightens setAlertModal payload typing.
src/components/Shell.utils.ts New startup helper utilities (orientation, failure classification, error messaging, initial alert state).
src/components/Shell.utils.spec.ts New Vitest coverage for the startup helper utilities.
src/components/Shell.tsx Uses safe orientation accessor and improved startup error classification to prevent false “storage disconnected” warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JackWilb JackWilb linked an issue Apr 16, 2026 that may be closed by this pull request
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.

Misleading "Storage Disconnected" Error Message?

2 participants