Skip to content

Dynamic og#19

Merged
listlessbird merged 5 commits into
mainfrom
dynamic-og
May 25, 2026
Merged

Dynamic og#19
listlessbird merged 5 commits into
mainfrom
dynamic-og

Conversation

@listlessbird
Copy link
Copy Markdown
Owner

No description provided.

@listlessbird listlessbird merged commit 3694aac into main May 25, 2026
0 of 3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b9f5ec35d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/og-consumer/index.ts
} satisfies OGStatus),
);

message.ack()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Let failed queue jobs retry instead of acknowledging them

Do not call ack() in the error path: this unconditionally deletes messages even when OG generation fails, so transient failures (Browser Rendering API, R2, DO RPC) are never retried and never reach the configured DLQ. With this consumer config (wrangler.og-consumer.json sets dead_letter_queue), failed deliveries should be left unacked/errored so the queue can apply retry/DLQ semantics.

Useful? React with 👍 / 👎.

Comment thread src/worker/lib/enque.ts
Comment on lines +25 to +35
await Promise.all([
env.OG_STATUS.put(
`og:${id}`,
JSON.stringify({
status: "pending",
createdAt: now,
updatedAt: now,
attempts: 0,
} satisfies OGStatus),
),
env.OG_QUEUE.send({ id } satisfies OGQueueMessage),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid writing pending status before queue enqueue is confirmed

This Promise.all performs OG_STATUS.put(...pending...) in parallel with OG_QUEUE.send(...); if send() throws (for example due queue throughput/backlog errors), the status can remain stuck as pending even though no message was queued. This creates incorrect job state and consumes a reserved budget slot without any consumer run.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant