Repository navigation
feat(cms): mark a page published once its Framer item is live on the site (#1331) - #1579
Merged
Merged
Conversation
…ord and send pages to it as draft posts (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… read when the Library opens and daily (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ss-server # Conflicts: # server/src/lib/content-delivery.test.js # supabase/schema.sql
Node 20 is end of life since 2026-04-30, and Framer's official Server API package (framer-api, for Send to CMS ansvisor#1331) needs Node 22 or later for its global WebSocket. Node 24 is LTS until April 2028. The Dockerfile, CI's server job and the server README move to 24; the web job stays on 20. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…re/cms-framer-server
…#1331) Framer's official Server API (framer-api, needs Node 22+): a brand's project connects with an API key made in it, sealed as WordPress's sign-in is. 00295 adds provider 'framer' (site_id = project id) and the 'framer' delivery target, and reserve_content_deliveries keeps one queued send per page for it too. Routes check the project, list the user's own collections with their fields, save the collection and field map (title to text, page to formatted text, required fields refused as for Webflow) and disconnect (Framer has no API to revoke a key). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nsvisor#1331) writeItem adds a draft item (draft: true) or updates the one the page's last Framer send made in that collection, keeping its state; the new id is read back by slug among new items, a clashing slug stops the send, and a draft with the page's slug and title left by a send that broke halfway is taken back. framer-items.js keeps tables (Framer's rich text has them), leaves media out and counts it, and maps title, page, meta and JSON-LD to the brand's fields. content-delivery.js gains the 'framer' target. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…site (ansvisor#1331) framer-status.js reads each page's latest Framer send (Library open and a daily sweep): an item out of draft, with a production publish after the send and after the item's last change, is published at the site's address plus the collection page's path with its slug; an item gone closes its send as "Removed in Framer". readPublished reads items, the publish and the detail page over one connection. POST /api/content-drafts/framer-status. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 12 tasks
7 of 12 tasks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… has ended Since ansvisor#1589 a workspace whose plan has ended can't write, but taking back an outside account's access stays open (COST_STOPPING), as Webflow's disconnect does. WordPress's disconnect revokes the Application Password where the site allows, so it joins the list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-published Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r-server Co-Authored-By: Claude Opus 5.5 <[email protected]>
… has ended Since ansvisor#1589 a workspace whose plan has ended can't write, but taking back an outside account's access stays open (COST_STOPPING), as Webflow's and WordPress's disconnects do. Framer's disconnect deletes the project's API key, so it joins the list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's product blocks (ansvisor#1607) are a grid of linked cards; Framer's formatted text has no grid, so the cards ran together in one paragraph. They now go as Webflow's do (productsAsList): a list, a product an item, its name linked and its price after it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 28, 2026
This was referenced Oct 28, 2026
9 of 12 tasks
gkhngyk
added a commit
that referenced
this pull request
Oct 28, 2026
* fix(cms): give a Webflow item sent again a date when it has none Follow-up from #1600 (item 1). Only a new item was given the day it's sent; an item sent again kept its date. So a brand that maps an optional date later, or makes its date required in Webflow, kept an empty date on every item sent before, and a send again left it empty. When the field map gives a date, sendToWebflow now reads the item before updating it (getItem, which says which fields hold a value) and, when its date is empty, sends today's with the update. An item that can't be read is updated without a date, as before; without a date field nothing is read. The Send to CMS guide's field table lists the Date field (#1507's follow-up) and says an item sent again keeps its date, or gets one. fieldDataFor (webflow-items.js) is unchanged, so this doesn't meet the Framer PRs' edit at its end (#1576, #1579). Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(cms): say which Webflow items are given the day they're sent Review follow-up. The comment above createItem still said only a new item is given the day it's sent, but an item sent again with an empty date now gets it too. It names both now. Comment only; webflow-items.js untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(cms): keep a Webflow item's date when the read didn't see its fields --------- Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Gökhan Geyik <[email protected]>
Collaborator
Author
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups
Reviewed this PR's own change: #1576's head 1ea6030 → ecedbf6 (the merge of #1576 into 75ad38a), 7 server files. On main (cfd8a35) it has one small conflict, in server/src/server.js's imports: main added import { sweepShoppingCardMatches } from './lib/catalog/card-match.js'; on the line where this PR adds import { sweepFramerPublished } from './lib/cms/framer-status.js';. Keep both.
What I checked
- What's read. Only the brand's sends to the collection connected now: status
sent, with an item id, from the last 60 days, each page's latest. That's up to 10 when the Library opens and 100 in the daily sweep, all in one connection to the project with #1575's 30 s timeout. No outbound request goes to the site: the live address is built from Framer's published address (https only) and the collection's detail-page path, with the item's slug encoded. It's kept only when it's https and ≤ 2,048 characters (liveAddress). - What's marked. An item is marked published only when all of these hold: it isn't a draft, the site was published after the send and after the item's last change, and the path has exactly one
:slug. A publish time that reads as more than ten minutes ahead marks nothing (the unit guess), and a draft state Framer doesn't give counts as a draft. An item gone from the collection closes its send ("Removed in Framer"), only while that send is stillsent. - Who can trigger it.
POST /content-drafts/framer-statuschecks the brand is in the caller's organization, sits behindcmsLimiter, and reads a brand at most every two minutes, as Webflow's and WordPress's do. A refused key marks the connection only if it's still the one read. - The daily sweep. Active subscriptions only, at most 1,000 connections, shuffled, with a 10-minute deadline. Each brand is one connection bounded at about 35 s (30 s use + 5 s close), so the deadline is overrun by one brand at most. One brand's failure is logged by name and code, and the next goes on.
- Tests:
framer-status.test.jsand the send route tests pass. Full server suite on the stack: 3,809 passed. They also pass under Node 20.
Follow-ups
- Reading the whole collection.
readPublishedreads every item, with all its fields (each page's full body), to find at most 100. Like #1576's follow-up: read only the items asked for, ifframer-apiallows it. framerCheckedgrows by one entry per brand checked and is never pruned, as Webflow's map is. That's fine at today's size; a sweep of old entries (or an LRU) belongs with the other two.
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
Send to CMS, phase 2 (#1331): Framer, part 3: a page sent to Framer becomes Published once its item is live on the site. Server only, as Webflow's (#1509) and WordPress's (#1570) checks are.
Stacked on #1576 (send), which is stacked on #1575 (connect). This PR's own change is its last commit.
Framer doesn't call anyone back when an item goes live, and a non-draft item is live only once the site is published. So Ansvisor reads it.
lib/cms/framer.jsreadPublishedreads everything over one connection:updatedAt;WebPageNodewith the collection'scollectionId, not a draft; the shortest if there are several).lib/cms/framer-status.js, built aswordpress-status.js:Which sends: each page's latest send to the connected collection, still
sent, from the last 60 days. The 10 newest are read when the Library opens (POST /api/content-drafts/framer-status, every member, once per brand every 2 minutes). Up to 100 per brand are read in the daily sweep (active subscriptions, shuffled, 10-minute deadline).When a page is published: all of these must hold.
updatedAtisn't later than that publish. Without that, an item taken out of draft after the last publish would read as live too early.:slug.The page is then marked published at the site's address plus that path, with the item's slug, through
markDeliveryPublished, as for the other CMSs.Removed: an item gone from the collection closes its send as "Removed in Framer". Sending the page again makes a new item.
Waiting: no production publish, no detail page, a path in another form, or a collection that's gone all leave the send as it is, and the next check reads it again.
Errors: a refused key, or one that can't be read, marks the connection
auth_failed. Other errors are logged by name and code, and the next check tries again.Not documented by Framer, so the code is careful:
deploymentTime's unit. It's read as milliseconds, with a value below 1e11 taken as seconds. A time more than 10 minutes ahead is read as no publish at all, so a wrong guess never marks anything./blog/:slugis assumed; any other form marks nothing and is logged once per check.updatedAtwhen it's taken out of draft. The check relies on it to tell an item that went live from one undrafted after the last publish.All three are worth a look in the real-project test (send → publish the site → take the item out of draft → check).
The address goes through
liveAddress(content-published.js), as the webhook callback's does: https only here, at most 2,048 characters. One that fails is logged and skipped, and the next send goes on.Next: the web (the Settings card, and the Send dialog's target with the Library reading
/framer-status), then the docs.Related issue
Part of #1331 (phase 2, Framer). Stacked on #1576 → #1575.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd server && npx vitest run src/lib/cms/framer-status.test.js src/lib/cms/framer.test.js src/routes/content-drafts-send.test.jsPOST /api/content-drafts/framer-status { brandId }: the page is marked published athttps://<site>/<collection path>/<slug>.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Server only:
npm run format,npm run lintandnpm test(3,112 tests) passed inserver/.The review's fixes:
updatedAtrule;liveAddress;:slug, an empty slug and an address that can't be kept;Follow-ups for a separate PR:
markRefused,closeRemoved, the latest-send loop, the sweep, the status routes);🤖 Generated with Claude Code