feat(LLMO-5003): enqueue async domain-wide covered marking after edge…#2484
Open
khushboo5723 wants to merge 1 commit into
Open
feat(LLMO-5003): enqueue async domain-wide covered marking after edge…#2484khushboo5723 wants to merge 1 commit into
khushboo5723 wants to merge 1 commit into
Conversation
… deploy After a domain-wide suggestion is successfully deployed, enqueue a domain-wide-covered-marking job to the import worker instead of relying on the synchronous Promise.all in deployToEdge, which times out at 2-3k+ suggestions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nit23uec
reviewed
May 26, 2026
| await context.sqs.sendMessage( | ||
| context.env.IMPORT_WORKER_QUEUE_URL, | ||
| { | ||
| type: DOMAIN_WIDE_COVERED_MARKING_TYPE, |
Contributor
There was a problem hiding this comment.
pls keep the name as PATTERN_COVERED_MARKING_TYPE to keep it generic enough to cover the segment use case also in future.
nit23uec
reviewed
May 26, 2026
| type: DOMAIN_WIDE_COVERED_MARKING_TYPE, | ||
| siteId, | ||
| opportunityId, | ||
| domainWideSuggestionIds: succeededDomainWideIds, |
Contributor
There was a problem hiding this comment.
patternBasedSuggestionIds
nit23uec
reviewed
May 26, 2026
| // Import worker job type for async domain-wide covered marking. | ||
| // Enqueued after a domain-wide edge deploy so the import worker marks all matching | ||
| // URL-level suggestions as coveredByDomainWide without blocking the API response. | ||
| export const DOMAIN_WIDE_COVERED_MARKING_TYPE = 'domain-wide-covered-marking'; |
Contributor
There was a problem hiding this comment.
pattern-based-covered-marking
nit23uec
requested changes
May 26, 2026
Contributor
nit23uec
left a comment
There was a problem hiding this comment.
it should be aligned to a generic pattern based terminology rather than being coupled with domain wide (which is a special case of pattern)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
domain-wide-covered-markingjob to the import worker SQS queue
DOMAIN_WIDE_COVERED_MARKING_TYPEconstant toedge-routing-utils.js(same pattern asOPTIMIZE_AT_EDGE_ENABLED_MARKING_TYPE)Promise.allindeployToEdgetimes out at 2-3k+ suggestions; the import worker jobguarantees marking happens regardless
Context
The edge-deploy API was synchronously making N parallel Postgres saves (one per URL-level suggestion)
to mark
coveredByDomainWide. At 2-3k+ suggestions this exceeds connection limits and fails silently.This change delegates the marking to the import worker asynchronously.
Part of LLMO-5003. The import worker handler (
domain-wide-covered-marking) is in a separate PR inspacecat-import-worker. The UI changes (30s hide-suggestions state) are in a separate PR in
project-elmo-ui.
Test plan
enqueues domain-wide-covered-marking job after successful domain-wide deploylogs warning but still returns 207 when domain-wide-covered-marking SQS enqueue failsnpm testpasses