Finally, updateListedServersByRangeAndDirection, which contains the concatMap, would not fire a second time causing the bug.
Steps to reproduce
N/A
Expected behavior
Expected is that the servers would fetch more than once when the base url is returned as an observable.
Screenshots
N/A
Additional context
This report is generally to find out why this was caused in the first place, and is not something that is blocking the application in any way. It would be nice to know the reason for this issue in case it does suddenly happen to something that can't be fixed as easily.
Describe the bug The issue is that this
concatMap
will only trigger once whenbaseUrl
is fetched using an observable: https://github.com/RoyDefined/WebDoomer/blob/09e2beb63d585c1cee263d337416b754a138851f/src/WebDoomerClient/src/app/stores/servers/servers.store.ts#L67The issue is related to this part of the code: https://github.com/RoyDefined/WebDoomer/blob/09e2beb63d585c1cee263d337416b754a138851f/src/WebDoomerClient/src/app/services/api/servers-api.service.ts#L46
Right now the store fetches the app settings before application load, and therefore can just provide the variable without the observable pattern as it is guaranteed to exist. https://github.com/RoyDefined/WebDoomer/blob/09e2beb63d585c1cee263d337416b754a138851f/src/WebDoomerClient/src/app/stores/appsettings/app-settings.store.ts#L18
Before the refactor the store would look like this:
The main server store would then fetch the base url by combining
pipe
andswitchmap
to get the base url for the observable request:Finally,
updateListedServersByRangeAndDirection
, which contains theconcatMap
, would not fire a second time causing the bug.Steps to reproduce N/A
Expected behavior Expected is that the servers would fetch more than once when the base url is returned as an observable.
Screenshots N/A
Additional context This report is generally to find out why this was caused in the first place, and is not something that is blocking the application in any way. It would be nice to know the reason for this issue in case it does suddenly happen to something that can't be fixed as easily.