If there is no AppHistoryEntry in appHistory.entries with the given key, both will reject with an "InvalidStateError" DOMException.
For same-document traversals intercepted by the navigate event’s transitionWhile() method, committed will fulfill as soon as the traversal is processed and appHistory.current is updated, and finished will fulfill or reject according to the promises passed to transitionWhile().
For non-intercepted same-document traversals, both promises will fulfill as soon as the traversal is processed and appHistory.current is updated
For cross-document traversals, both promises will never settle.
Steps to Reproduce
async function currentChangedExample(appHistory: AppHistory) {
const url = `/${Math.random()}`;
await appHistory.navigate(url).comitted;
assert<AppHistoryEntry>(appHistory.current);
assert(appHistory.current.url === url);
assert(appHistory.transition); // The transition should still be in progress.
}
Expected Behavior
The navigation change should be available once committed it resolved.
Prerequisites
Version
1.0.1-alpha.75
Node.js version
17.2.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.0.1
Description
committed
is resolved too early, and instead should be resolved oncecurrent
has been updated related to that entry.https://github.com/WICG/app-history/blob/7c0332b30746b14863f717404402bc49e497a2b2/spec.bs#L860-L863
Steps to Reproduce
Expected Behavior
The navigation change should be available once
committed
it resolved.