Fixes #44 Bridge silently stops receiving changes behind Cloudflare Tunnel / reverse proxy #45
Open
evmin wants to merge 1 commit into
Open
Fixes #44 Bridge silently stops receiving changes behind Cloudflare Tunnel / reverse proxy #45evmin wants to merge 1 commit into
evmin wants to merge 1 commit into
Conversation
…vironments Add opt-in useShortPolling config option for CouchDB peers. When enabled, replaces PouchDB's persistent _changes feed with periodic HTTP polling via Deno fetch(), preventing silent stalls caused by proxy idle timeouts. - useShortPolling (default: false) — opt-in, no behavior change for existing users - pollIntervalMs (default: 5000) — interval between polls - pollTimeoutMs (default: 50000) — HTTP timeout per request Stable for 4+ weeks behind Cloudflare Tunnel with zero stalls.
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.
Fixes #44
What this does
Adds an opt-in
useShortPollingoption for CouchDB peers. When enabled, the bridge polls_changeswith short-lived HTTP requests instead of holding a persistent connection that reverse proxies silently kill.Config
Three new optional fields on CouchDB peers (all backward-compatible, default off):
{ "useShortPolling": true, "pollIntervalMs": 5000, "pollTimeoutMs": 50000 }What's included
PeerCouchDB.ts— polling loop viaDeno.fetch(), with chunk retry logictypes.ts— new config fields with JSDocreadme.md— new "Cloudflare Tunnel / Reverse Proxy Support" sectiondat/config.sample.json— fields added to sampleNo changes to
lib/submodule. OriginalbeginWatch()path is fully preserved whenuseShortPollingisfalse(default).Testing
Running in production for 4+ weeks behind Cloudflare Tunnel (CouchDB 3.5.1, Deno 2.7.5). Create/edit/delete sync in 5-10s, checkpoint persistence across restarts, zero stalls since deployment.