docs: the superseded fallback answers its own session; who uses beacon()
This commit is contained in:
@@ -285,11 +285,12 @@ export function identityHeaders(): Record<string, string> {
|
||||
};
|
||||
}
|
||||
|
||||
// Fire-and-forget POST that survives page unload (keepalive) — shared by the resume-position
|
||||
// beacons (YT + Plex players). A normal fetch is cancelled on unload and React effect cleanup
|
||||
// doesn't run on a full reload, so without keepalive the last position (esp. right after a seek)
|
||||
// would be lost. `onSettled`: the request has been answered (or failed) — for a caller whose cached
|
||||
// view must be read again once the write is on the server.
|
||||
// Fire-and-forget POST that survives page unload (keepalive) — for every write a closing page must
|
||||
// still make: the resume checkpoints of the YouTube, Plex and library players, the Plex session stop,
|
||||
// the diagnostics flush. A normal fetch is cancelled on unload and React effect cleanup doesn't run
|
||||
// on a full reload, so without keepalive the last position (esp. right after a seek) would be lost.
|
||||
// `onSettled`: the request has been answered (or failed) — for a caller whose cached view must be
|
||||
// read again once the write is on the server.
|
||||
export function beacon(url: string, body: Record<string, unknown>, onSettled?: () => void): void {
|
||||
try {
|
||||
void send(url, {
|
||||
|
||||
Reference in New Issue
Block a user