Skip to content

Report notifyLaravel failures under SHELL_VERBOSITY - #140

Open
sadiqk2 wants to merge 1 commit into
NativePHP:mainfrom
sadiqk2:report-swallowed-notify-failures
Open

Report notifyLaravel failures under SHELL_VERBOSITY#140
sadiqk2 wants to merge 1 commit into
NativePHP:mainfrom
sadiqk2:report-swallowed-notify-failures

Conversation

@sadiqk2

@sadiqk2 sadiqk2 commented Aug 14, 2026

Copy link
Copy Markdown
export async function notifyLaravel(endpoint: string, payload = {}) {
    ...
    try {
        await axios.post(`http://127.0.0.1:${state.phpPort}/_native/api/${endpoint}`, payload, ...);
    } catch {
        //
    }
}

Every failure here is discarded, which makes these indistinguishable from a healthy app:

  • the PHP server has died or has not finished booting
  • a route returns 500
  • PreventRegularBrowserAccess returns 403 because the secret does not match
  • the app has no /_native/api/events route at all

In each case no event arrives, nothing appears in the Electron console, and the only symptom is a UI that quietly does not respond to native events.

This gates a console.error on SHELL_VERBOSITY, which php.ts already uses for its own command logging, so default runs stay as quiet as they are today.

I appreciate the empty catch is deliberate — the runtime should not fall over because the app is briefly unreachable, and that behaviour is unchanged here. Happy to move it behind NODE_ENV === 'development' instead, or to drop the gate entirely, whichever fits better.

Every failure posting to the PHP app is currently swallowed, so an app that is
down, 500ing or 403ing looks exactly like a healthy one — no event arrives and
nothing says why.

Gated on SHELL_VERBOSITY so normal runs stay quiet, matching how php.ts already
gates its command logging.
@sadiqk2

sadiqk2 commented Aug 17, 2026

Copy link
Copy Markdown
Author

@simonhamp kindly review

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