mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 06:05:31 +03:00
Avoid a case of infinite recursion for DataSource resolution.
This commit is contained in:
parent
dcf19fd443
commit
86e76ae9f6
@ -95,7 +95,12 @@ cacheRequestResolution request rawResponses =
|
||||
cacheRequestResolutionHelp True [] rawResponses request request
|
||||
|
||||
Request urlList lookupFn ->
|
||||
cacheRequestResolutionHelp False urlList rawResponses request (lookupFn Nothing rawResponses)
|
||||
if urlList |> List.isEmpty then
|
||||
cacheRequestResolutionHelp False urlList rawResponses request (lookupFn Nothing rawResponses)
|
||||
|
||||
else
|
||||
Incomplete urlList
|
||||
(Request [] lookupFn)
|
||||
|
||||
ApiRoute value ->
|
||||
Complete value
|
||||
@ -118,9 +123,14 @@ cacheRequestResolutionHelp firstCall foundUrls rawResponses parentRequest reques
|
||||
case request of
|
||||
RequestError error ->
|
||||
case error of
|
||||
MissingHttpResponse _ _ ->
|
||||
MissingHttpResponse _ requests ->
|
||||
-- TODO do I need to pass through continuation URLs here? -- Incomplete (urlList ++ foundUrls)
|
||||
Incomplete foundUrls parentRequest
|
||||
--Incomplete (requests ++ foundUrls) parentRequest
|
||||
if List.isEmpty foundUrls then
|
||||
Incomplete requests parentRequest
|
||||
|
||||
else
|
||||
Incomplete foundUrls parentRequest
|
||||
|
||||
DecoderError _ ->
|
||||
HasPermanentError error parentRequest
|
||||
@ -129,8 +139,16 @@ cacheRequestResolutionHelp firstCall foundUrls rawResponses parentRequest reques
|
||||
HasPermanentError error parentRequest
|
||||
|
||||
Request urlList lookupFn ->
|
||||
Incomplete urlList
|
||||
(Request [] lookupFn)
|
||||
if urlList |> List.isEmpty then
|
||||
cacheRequestResolutionHelp False
|
||||
foundUrls
|
||||
rawResponses
|
||||
request
|
||||
(lookupFn Nothing rawResponses)
|
||||
|
||||
else
|
||||
Incomplete urlList
|
||||
(Request [] lookupFn)
|
||||
|
||||
ApiRoute value ->
|
||||
Complete value
|
||||
|
Loading…
Reference in New Issue
Block a user