Skip to content

A pod that rate-limits gets retries at the app's own pace, never the pace the server asks for, and the learner is never told the server asked the app to wait #1087

Done

Description

@ixuz

What happened

This was found by reading the code on main and is not reproduced here. #601 reported the symptoms on solidcommunity.net, which has Cloudflare in front of it, and was closed. The fixes proposed there (a per-pod pause after a rate limit, jittered retries, a test with a pod that rate-limits) did not land. As noted there, the JavaScript Solid Server rate-limits at 60 requests a minute.

Reads. A read fails with 429, 408, a 5xx or a network error. It is retried up to 3 times (main.tsx:43, retryable.ts:9), with TanStack Query's default delay of 1 s, 2 s and 4 s. That's about 7 s in all, with no randomness, and each query keeps its own count. So when a page's burst of reads gets rate-limited, every query retries on the same schedule, and the retries land in the next rate-limit window together.

The server's instructions. Nothing in the app reads Retry-After. A server that says "wait 60 s" gets three more requests within about 7 s, then the app gives up. There are two cases:

Writes. No write is retried on 429 or 503:

  • A grade's answer that fails waits in the queue until the next answer (answerStore.ts:89). So on a rate-limited pod, each grade sends a request again straight into the limit.
  • Any other write fails at once.

What the learner sees. While the retries run, the screen just shows it is loading. Nothing says the server asked the app to slow down. When the retries run out, a 429 isn't an AppError, so it shows as common.unexpectedError (i18n.tsx:493): "Something went wrong. Try again, or reload the page. Details: …". The details are the raw HTTP error. Trying again or reloading at once sends another burst into the same limit.

Expected:

  • The app waits as long as the server asks, where it can see the request (Retry-After), and otherwise backs off with randomness.
  • One wait is shared by every request to that server, reads and writes alike.
  • The learner is told the server is busy and that the app will try again on its own.

Steps to reproduce

  1. Log in with a pod on a server that rate-limits: solidcommunity.net (Cloudflare), or a JavaScript Solid Server at 60 requests a minute.
  2. Open the deck list of an instance with several decks, or study and grade quickly.
  3. In the browser's network tab, see 429s (or CORS errors, where the 429 has no CORS headers), each read retried 1 s, 2 s and 4 s later whatever the server's Retry-After says.
  4. See the screen keep loading with no word about the server, then "Something went wrong" with the HTTP error as its details.

Where

The deck list, study, and any screen that reads or writes the pod

Version

0d20876

Browser and system

No response

Pod

solidcommunity.net (Cloudflare rate limiting), or a JavaScript Solid Server

The app's language

English

Anything else

A possible fix, in the order it would land:

  1. One wait per server. A gate in the fetch chain of solid that every request to an origin passes through. After a 429 or 503, it pauses that origin for Retry-After when the response shows it (seconds or a date, capped), and otherwise for a jittered exponential backoff. A network error with no status during a burst counts as a possible rate limit. The gate makes reads and writes alike wait their turn, so the queries' own retries and the answer queue stop sending into the limit.
  2. Limit how many requests go to one pod at once, as Lots of CORS and 429 errors on https://solidcommunity.net #601 proposed, so the burst that causes the limit is smaller.
  3. Tell the learner. While a server's wait lasts, the screen says something like "Your pod's server asked Solid Memo to slow down. Trying again in 40 s." Once retries run out, the error says the server is busy and that waiting helps, not "Something went wrong" with raw details. This needs a new AppError (for example podBusy, with the server and the wait), translated in every locale.
  4. A test with a pod that rate-limits, with and without CORS headers on its 429, so this doesn't come back.

Servers that want the app to honor Retry-After need to send CORS headers on the 429 and list Retry-After in Access-Control-Expose-Headers. That belongs in the interop docs (docs/testing.md) and in a note to server maintainers.

The pause between 412 tries is a separate issue, about write conflicts, not about the server's pace.

Activity

  1. added
    bug
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buginterop

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions