@coolon/angular-ui-powerups 16.1.0-alpha.223 → 16.1.0-alpha.224

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,13 @@ export declare abstract class NavigationSession extends GarbageCollector {
22
22
  private _interactionContext;
23
23
  constructor(context: NavigationContext, startingUrl: string);
24
24
  get isInteractionSync(): boolean;
25
+ /**
26
+ * Interruptible sessions are internal housekeeping navigations (e.g. interaction-id
27
+ * synchronisation) that a real user- or model-driven navigation is allowed to queue behind
28
+ * and supersede, rather than being rejected. Real navigations (Navigating, PopState) are not
29
+ * interruptible.
30
+ */
31
+ get isInterruptible(): boolean;
25
32
  get name(): string;
26
33
  get urlService(): UrlService;
27
34
  get interactionServiceAdapter(): InteractionServiceRoutingAdapter;
@@ -26,6 +26,9 @@ export declare class PlaceRouter extends GarbageCollector {
26
26
  private readonly _activeVisit$;
27
27
  private readonly routerInteractionAdapter;
28
28
  private sessionFinishedJobs;
29
+ private pendingNavigation?;
30
+ private queuedNavigationDepth;
31
+ private static readonly MAX_QUEUED_NAVIGATION_DEPTH;
29
32
  readonly authService: PlaceAuthService;
30
33
  private readonly _ready$;
31
34
  readonly ready$: ValueModel<boolean>;
@@ -48,6 +51,20 @@ export declare class PlaceRouter extends GarbageCollector {
48
51
  navigate(visit: Visit): any;
49
52
  navigate(placeComponent: Constructable<PlaceComponent>, params?: Record<string, unknown>): any;
50
53
  doNavigation(visit: Visit, runNavigationCommands: (router: Router) => unknown): Promise<void>;
54
+ /**
55
+ * Handles a navigation triggered while another is already in flight.
56
+ *
57
+ * This used to throw `illegalState('Navigation already in progress')`, which killed the
58
+ * triggering action - occasionally seen in production when a user click collided with an
59
+ * in-flight interaction-id sync. Instead we warn with diagnostic context and decide based on the
60
+ * in-progress session:
61
+ * - interruptible session in progress (internal housekeeping, e.g. interaction-id sync) -> queue
62
+ * the incoming navigation and run it once the current session finishes (coalescing to latest).
63
+ * - real navigation in progress -> keep it and drop the incoming one (logging full context).
64
+ */
65
+ private handleOverlappingNavigation;
66
+ private queueNavigation;
67
+ private flushPendingNavigation;
51
68
  navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras): Promise<boolean>;
52
69
  get activeVisit$(): ValueModel<Visit>;
53
70
  filterAuthorizedPlaces(places: ReadonlyArray<Constructable<PlaceComponent>>, options: DisposedWith): ListModel<Constructable<PlaceComponent>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.223",
3
+ "version": "16.1.0-alpha.224",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",