Fallback to use nextResultKey on mount #73
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
RequestHock
has an issue when a new RequestHock mounts and refetches using aresultKey
that already has data returned for it (data that is held in the enty state store). On mount, theRequestHock
was not bringing theresultKey
into its own state, so it would not show existing response data, but it would use the refetching request state rather than the fetching request state. This meant that it was possible to haveundefined
results in arefetchingMap
in cases where that data's existence should be guaranteed.As all enty state around
resultKey
s is held outside of theRequestHock
, then the RequestHock should essentially be a slave to that state.Current behaviour
"A" and "B" are example resultKeys. The
resultKey
incidates whichresultKey
is being used to pull data from the enty state store.If we were to then remount the
RequestHock
and request the most recentresultKey
again, the following would occur:"!!!" marks where the
resultKey
is not set, but should have "B". It's known that "B" will be returned, as it has just been requested, so showing any possibly-existing response data during refetching makes sense.