Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions servers/cu/src/effects/hb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export const loadMessagesWith = ({ hashChain, fetch, logger: _logger, pageSize }
body.edges.length === (+to - +from + 1) &&
+body.edges[0]?.node?.assignment?.Tags?.find(t => t.name === 'Nonce' || t.name === 'Slot')?.value === +from
if (bodyIsValid) return body
// if (!dryRun) throw new Error('Body is not valid: would attempt to fetch from scheduler in loadMessages')
if (!dryRun) throw new Error('Body is not valid: would attempt to fetch from scheduler in loadMessages')
return fetchPageDataloader.load({ suUrl, processId, from, to, pageSize })
},
{ maxRetries: 1, delay: 500, log: logger, name: `loadMessages(${JSON.stringify({ suUrl, processId, params: params.toString() })})` }
Expand Down Expand Up @@ -607,15 +607,13 @@ export const loadMessagesWith = ({ hashChain, fetch, logger: _logger, pageSize }

export const loadMessageMetaWith = ({ fetch, logger }) => {
return async ({ suUrl, processId, messageUid, body }) => {
const params = toParams({ processId, to: messageUid, from: messageUid, pageSize: 1 })
return backoff(
() => {
const bodyIsValid = body &&
body.edges.length === 1 &&
+body.edges[0]?.node?.assignment?.Tags?.find(t => t.name === 'Nonce' || t.name === 'Slot')?.value === +messageUid
if (bodyIsValid) return body
// throw new Error('Body is not valid: would attempt to fetch from scheduler in loadMessageMeta')
return fetch(`${suUrl}/~scheduler@1.0/schedule?${params.toString()}`).then(okRes)
throw new Error('Body is not valid: would attempt to fetch from scheduler in loadMessageMeta')
},
{ maxRetries: 2, delay: 500, log: logger, name: `loadMessageMeta(${JSON.stringify({ suUrl, processId, messageUid })})` }
)
Expand Down