fix(subscribestar): initial feed GET is a navigation, not XHR (first-run drift) #118

Merged
bvandeusen merged 1 commits from dev into main 2026-06-17 14:30:02 -04:00
Owner

First live SubscribeStar run (cheunart) tripped the drift guard. Root cause: the client set X-Requested-With: XMLHttpRequest session-wide, so the initial creator-page GET was flagged XHR → SubscribeStar (Rails) content-negotiated it to a non-HTML body with no posts_container-list → drift. The browser-saved page was normal (parser is fine); only our live fetch differed.

Fix: initial feed GET uses browser-like navigation headers (Accept: html, no XHR); the XHR header + JSON Accept apply per-request only on the "load more" endpoint. Drift message now reports response length + a JSON hint. Regression test pins the header split.

CI green on dev (run 1224, 78a3977). Re-pull download-worker after deploy and re-run a SubscribeStar source.

🤖 Generated with Claude Code

First live SubscribeStar run (cheunart) tripped the drift guard. Root cause: the client set `X-Requested-With: XMLHttpRequest` session-wide, so the initial creator-page GET was flagged XHR → SubscribeStar (Rails) content-negotiated it to a non-HTML body with no `posts_container-list` → drift. The browser-saved page was normal (parser is fine); only our live fetch differed. Fix: initial feed GET uses browser-like navigation headers (Accept: html, no XHR); the XHR header + JSON Accept apply per-request only on the "load more" endpoint. Drift message now reports response length + a JSON hint. Regression test pins the header split. CI green on dev (run 1224, 78a3977). Re-pull download-worker after deploy and re-run a SubscribeStar source. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-17 14:29:50 -04:00
fix(subscribestar): initial feed GET is a navigation, not XHR (first-run drift)
CI / lint (push) Successful in 2s
CI / frontend-build (push) Successful in 18s
CI / backend-lint-and-test (push) Successful in 33s
CI / integration (push) Successful in 3m14s
78a3977f8a
First live run (cheunart) tripped the drift guard: "no posts and no recognizable
feed container". The browser-saved page was normal (6 posts + posts_container-list),
so the parser was fine — our live HTTP fetch got a different response. Cause: the
client set X-Requested-With: XMLHttpRequest (+ a JSON Accept) session-wide, so the
initial creator-page GET was sent as an XHR. SubscribeStar (Rails) content-
negotiates an XHR full-page request to a non-HTML body → no container → drift.

Fix: the session now uses browser-like navigation headers (Accept: html, NO
X-Requested-With); the XHR header + JSON Accept are applied PER-REQUEST only on
the "load more" endpoint (which is a genuine XHR). Drift message now reports the
response length + a JSON hint so a recurrence is self-explaining. Regression test
pins the header split (navigation initial GET, XHR load-more).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bvandeusen merged commit 26dcfaf6c2 into main 2026-06-17 14:30:02 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#118