forkJoin([]) requests are being cancelled

Discussão em 'Angular' iniciado por Sunstrike527, Março 20, 2025.

  1. Sunstrike527

    Sunstrike527 Guest

    I am trying to do parallel requests with forkJoin but sometimes for no reason one of the request is cancelled or one of requests returns 200 but data Failed to load response data . If I make sepratae requests they work as expected.

    private _getGeneralEventInfo() {
    const id = this.route.snapshot.paramMap.get('id');

    if (id) {
    // Working if make separate requests
    // this._getEventInfo(id).subscribe();
    // this.typeOfService.getTypeOfServices().subscribe();
    // this.workOrder.getEquipments().subscribe();

    forkJoin([
    this._getEventInfo(id),
    this.typeOfService.getTypeOfServices(),
    this.workOrder.getEquipments(),
    ])
    .pipe(
    isLoading(v => this.$isLoading.set(v)),
    takeUntilDestroyed(this.destroyRef),
    )
    .subscribe();
    }
    }


    sometimes 200 but with failed data [​IMG]

    sometimes cancelled [​IMG]

    Continue reading...

Compartilhe esta Página