Conversation
|
@dada878 is attempting to deploy a commit to the diwenne's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Meta can return error code 1 after a comment reply has reached the recipient. The worker currently treats that unknown result as a button-template rejection, sends a text fallback, and logs the comment as retryable. The polling reconciler then creates fresh jobs every five minutes; each job resets
DmLog.attemptsfrom its own BullMQ counter. A single comment can therefore produce repeated messages indefinitely.This change claims the DM and public-reply legs atomically in
DmLogbefore contacting Instagram. Unknown/network outcomes and failed result writes retain the claim, while explicit rejections release it. DM attempts are counted durably across jobs and capped at three; polling also skips uncertain and exhausted deliveries, including historical Meta code 1/2/5xx failures. New comments continue normally, without pausing campaigns.Plain-text fallback now requires a specific Meta code 100 template/button rejection and preserves the fallback's own error if that second send is uncertain. Meta postbacks also use the existing durable per-tap claim, as Zernio postbacks already do.
This deliberately favors avoiding duplicates after an uncertain outcome or a process crash between claiming and sending. Inspect the inbox before manually retrying those deliveries. No schema migration is required. The change is based on current
main(5760181) and contains no saved-template feature changes.Validation:
main: ambiguous Meta response, reset attempt budget, missing pre-send claim, and redelivered Meta postback.npm run typecheck,npm run lint, andnpm run buildpass.TEST_DATABASE_URL=... npm test: 312 tests pass in 28 files, including real PostgreSQL tests in disposable schemas for simultaneous claims, persistent attempt limits, and independent public/DM claims.