fix: ack MULTIPOST_EXTENSION_PUBLISH so callers don't hit timeout#211
Draft
harryisfish wants to merge 1 commit into
Draft
fix: ack MULTIPOST_EXTENSION_PUBLISH so callers don't hit timeout#211harryisfish wants to merge 1 commit into
harryisfish wants to merge 1 commit into
Conversation
The web client (apps/web/lib/extension/index.ts funcPublish) sends a
MULTIPOST_EXTENSION_PUBLISH message through the content-script bridge,
which uses chrome.runtime.sendMessage and awaits the response. The
background handler opened a popup but never called sendResponse - combined
with the listener's return true (kept the port open), this meant
funcPublish always waited the full 30s before reporting a fake failure.
Production impact (web-side PostHog over 7 days):
publish_initiated = 812
publish_failed = 792 (all Request timeout after 30000ms)
publish_success = 0
This change adds a synchronous sendResponse({ queued: true }) so the
caller resolves immediately. The popup-driven publish flow is unchanged;
the real result still flows through MULTIPOST_EXTENSION_PUBLISH_NOW.
🤖 LeoCode Review⏳ 等待审查... 最后更新: 2026-05-20 14:55 · 2a372a2 |
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
The web client (`leaperone/MultiPost` → `apps/web/lib/extension/index.ts` `funcPublish`) sends a `MULTIPOST_EXTENSION_PUBLISH` message through the content-script bridge, which uses `chrome.runtime.sendMessage` and awaits the response. The background handler opened a popup but never called `sendResponse` — combined with the listener's `return true` (kept the port open), this meant `funcPublish` always waited the full 30s before reporting a fake failure.
Evidence (web-side PostHog, 7 days)
That's a 97.5% false failure rate — but the actual publish flow works fine for users; only the web-side promise hangs.
Change
One-line ACK in the `MULTIPOST_EXTENSION_PUBLISH` branch:
```ts
sendResponse({ queued: true });
```
The popup-driven publish flow is unchanged. The real result still flows through `MULTIPOST_EXTENSION_PUBLISH_NOW` later.
Companion PR
The web side has a complementary fix (`leaperone/MultiPost#251`) that splits the event into `publish_dispatched` and drops timeout-flavored `publish_failed` reports. With both PRs landed, `funcPublish` will resolve with `{ success: true }` immediately upon ACK, and the false-failure noise goes away.
Test plan