Repository navigation
Conversation
…ploys LinkedIn has no profile-changed webhook, so a standalone Cloudflare Worker (workers/linkedin-sync) collects change signals and turns them into a single redeploy once they have been quiet for 2 hours. - One Durable Object owns the debounce timer: every signal pushes its alarm out to now + DEBOUNCE_MINUTES (120), capped by MAX_WAIT_MINUTES (24h). When the alarm fires it sends repository_dispatch content-changed, which runs content-release.yml. A failed dispatch stays pending and the alarm retries with backoff. - Signals: POST /hook (Shortcut, mail rule, curl), PUT /export (upload a LinkedIn export ZIP, kept in R2 and served to CI via GET /export with a read-only token), and an hourly cron that hashes the DMA Snapshot API data when LINKEDIN_DMA_TOKEN is set (EEA/CH accounts only). - GET /status and POST /flush for visibility and manual deploys. - Debounce logic is runtime-agnostic and unit tested with node --test; CI runs the tests and a type-check against generated Workers types.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Stacked on #4. Next: #6.
LinkedIn has no "profile changed" webhook, so
workers/linkedin-syncis a standalone Cloudflare Worker. It collects change signals and turns them into one redeploy once they have been quiet for 2 hours.How it works
now + DEBOUNCE_MINUTES(120).MAX_WAIT_MINUTES(24 h) stops a constant trickle of edits from postponing forever. When the alarm fires, the worker sendsrepository_dispatch: content-changedwith the collected reasons.POST /hook: an iOS Shortcut, a mail rule on LinkedIn's notification emails, orcurl.PUT /export: upload the LinkedIn data-export ZIP. It is stored in R2 and served to CI viaGET /exportwith a separate read-only token, socontent:fetchbuilds from it. For a non-EEA account this is how new LinkedIn data reaches the site. Re-uploading an identical file is ignored.LINKEDIN_DMA_TOKENis set (EEA/CH accounts). It hashes the official Snapshot API data canonically and signals on change; the first hash is a baseline.GET /statusshows what's pending and when it fires, plus the last dispatch result.POST /flushdeploys now.?token=also works for senders that can't set headers.Setup
See
workers/linkedin-sync/README.md:wrangler r2 bucket create linkedin-exportsHOOK_SECRET,EXPORT_READ_TOKEN, andGITHUB_TOKEN(a fine-grained PAT with Contents: read & write on this repo, whichrepository_dispatchrequires).pnpm worker:deployLINKEDIN_EXPORT_URL(variable) andLINKEDIN_EXPORT_TOKEN(secret).Verification
pnpm worker:test: 6node --testcases for the debounce state machine (window reset, max-wait cap, single dispatch, retry on failure, mid-dispatch signal, fingerprint baseline).pnpm worker:check: tsc against generated Workers types. Both run in CI.wrangler dev, with a 3 s debounce and a mock GitHub API:LINKEDIN_EXPORT=<worker>/export pnpm content:fetchparses the uploaded ZIP.Generated by Claude Code