Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setData(data) and request payload limit #21

Closed
mingyc opened this issue Aug 9, 2022 · 1 comment
Closed

setData(data) and request payload limit #21

mingyc opened this issue Aug 9, 2022 · 1 comment

Comments

@mingyc
Copy link
Collaborator

mingyc commented Aug 9, 2022

It's not mentioned in current explainer, but I assume browser should impose a limit for request payload similar to navigator.sendBeacon()'s one?

navigator.sendBeacon() returns false if the amount of data to be queued exceeds the user agent limit. It's partly because the underlying implementation is using Fetch API, where there is a discussion about payload limits in w3c/beacon#39. But for PendingBeacon, it's not specified to to use Fetch.

Should setData(data) throw exception or return false? (Whether to throw exception from PendingBeacon API is also not specified yet)

@mingyc
Copy link
Collaborator Author

mingyc commented Nov 13, 2023

Request payload limit is addressed in #76 (comment) and #66

setData(data) now longer exists in fetchLater(), which supports request body via its RequestInfo or DeferredRequestInit args, e.g.

fetchLater(url, {
  body: ...
});

After calling the API, the request is not updatable. Developers will have to abort previous pending fetchLater requests first. See also Update a pending request.

@mingyc mingyc closed this as completed Nov 13, 2023
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

No branches or pull requests

1 participant