solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

[Bug?]: Infinite loop when a server function returns unexpected XML

Open yinonburgansky opened this issue 7 months ago • 0 comments

Duplicates

  • [x] I have searched the existing issues

Latest version

  • [x] I have tested the latest version

Current behavior 😯

When running AWS serverless, sometimes we get unexpected responses from server functions like:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message></Error>

This response causes an infinite loop which freezes the browser and causes a memory leak.

The response is handled in this function: https://github.com/solidjs/solid-start/blob/f4052b2532b54ba09b74f566f6502e0ae522a255/packages/start/src/runtime/server-runtime.ts#L143 https://github.com/solidjs/solid-start/blob/f4052b2532b54ba09b74f566f6502e0ae522a255/packages/start/src/runtime/server-runtime.ts#L187

The infinite loop in: https://github.com/solidjs/solid-start/blob/f4052b2532b54ba09b74f566f6502e0ae522a255/packages/start/src/runtime/server-runtime.ts#L83

The error: https://github.com/solidjs/solid-start/blob/f4052b2532b54ba09b74f566f6502e0ae522a255/packages/start/src/runtime/server-runtime.ts#L60 head = "?xml versi" bytes = NaN

I can add a check for NaN but I think it might be worth to also handle unexpected responses higher up in the fetchServerFunction

Expected behavior 🤔

No response

Steps to reproduce 🕹

Steps:

Context 🔦

No response

Your environment 🌎


yinonburgansky avatar Jun 01 '25 15:06 yinonburgansky