StudyGrow / Cards

MIT License
1 stars 0 forks source link

Ngrx Store not receiving cached response from Observable from interceptor #93

Open erdzan12 opened 3 years ago

erdzan12 commented 3 years ago

In GitLab by @lakhoune on Oct 19, 2020, 11:04

Location: effects.ts file on fetchCards and fecthLectures actions Description: The interceptor creates an Observable from the cached response, but the the response is not passed on in the service, nor in the effects pipe chain Expected behaviour: effect makes a call to the service, which will load the cards from the server. This call is intercepted by the http interceptor which will look up if there is a cached response. If there is one it will return an observable of the response and not make an http call to the server. The observable is returned by the service and the store gets the response and updates its data Steps to reproduce: Go to a lecture. Refresh the page. The cards will be undefined

erdzan12 commented 3 years ago

In GitLab by @lakhoune on Oct 19, 2020, 11:06

about ngrx store effects: Guide

about http interceptors: Docs , Guide

erdzan12 commented 3 years ago

In GitLab by @lakhoune on Nov 2, 2020, 17:11

Stackoverflow issue

erdzan12 commented 3 years ago

In GitLab by @lakhoune on Jan 27, 2021, 16:44

mentioned in commit 6fb4b4f40fff837421b8cc831b8f519b7c731f20

erdzan12 commented 3 years ago

In GitLab by @lakhoune on Jan 27, 2021, 16:48

It seems like the issue happends only if the component has not yet been initialized. The behaviour can be observed when doing the following: