LinkedIn publishing works again; rename Inbox to Posts

LinkedIn:
- The API version was fixed at 202501, retired by LinkedIn (426
  NONEXISTENT_VERSION). It's now the month before last, stepping back a
  month (up to four) if LinkedIn says a version isn't active.
- The versioned Posts API needs a title for a link's article card (422).
  Supermarket reads the linked page's title and description and sends
  them, falling back to the page's address as the title.
Tested for real: a post with a link went out to the member's profile.

Inbox is now Posts: the menu, page, messages and docs; the page moves to
/posts, and /inbox redirects there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 12:50:06 -07:00
co-authored by Claude Opus 5.5
parent 7733672706
commit 4b2d791909
21 changed files with 273 additions and 73 deletions
+4 -4
View File
@@ -93,7 +93,7 @@ func TestEveryPageRenders(t *testing.T) {
for _, path := range []string{"/", "/?msg=saved", "/settings/profile", "/inventory", "/inventory?relationship=partner",
"/inventory/new", "/inventory/1", "/inventory/import", "/inventory/export",
"/settings/ai", "/settings/accounts", "/settings/core", "/static/app.css", "/favicon.ico", "/static/favicon.png", "/static/logo.png", "/static/apple-touch-icon.png", "/search", "/search?q=rival", "/search?q=nothing+here", "/static/htmx.min.js", "/healthz",
"/content", "/content/1", "/content/1?dismissed=1", "/inbox", "/inbox?msg=drafted",
"/content", "/content/1", "/content/1?dismissed=1", "/posts", "/posts?msg=drafted",
"/content/scheduled", "/content/published"} {
rec := do(h, http.MethodGet, path, nil, nil)
if rec.Code != http.StatusOK {
@@ -260,7 +260,7 @@ func TestAIKeysOnTheAITab(t *testing.T) {
func TestOldAddressesRedirect(t *testing.T) {
_, h := newTestServer(t, nil)
for old, now := range map[string]string{"/profile": "/settings/profile", "/core": "/settings/core",
for old, now := range map[string]string{"/profile": "/settings/profile", "/core": "/settings/core", "/inbox": "/posts",
"/settings/credentials": "/settings/accounts", "/settings": "/settings/profile"} {
rec := do(h, http.MethodGet, old, nil, nil)
if rec.Code/100 != 3 || rec.Header().Get("Location") != now {
@@ -283,7 +283,7 @@ func TestSearch(t *testing.T) {
t.Fatal(err)
}
body := do(h, http.MethodGet, "/search?q=GADGET", nil, nil).Body.String()
for _, want := range []string{"Rival Corp", "Gadget 2 launches", "Our widgets beat any gadget", `href="/content/1"`, `href="/inbox"`} {
for _, want := range []string{"Rival Corp", "Gadget 2 launches", "Our widgets beat any gadget", `href="/content/1"`, `href="/posts"`} {
if !strings.Contains(body, want) {
t.Errorf("search for gadget: missing %q", want)
}
@@ -422,7 +422,7 @@ func TestLinkedInExpiryReminders(t *testing.T) {
// Saved before expiries were recorded, 50 days ago: 10 days left.
_ = s.saveConnection("linkedin", Connection{At: time.Now().Add(-50 * day)})
for _, path := range []string{"/", "/inbox"} {
for _, path := range []string{"/", "/posts"} {
if body := get(path); !strings.Contains(body, "LinkedIn's sign-in expires in 9 days") && !strings.Contains(body, "LinkedIn's sign-in expires in 10 days") {
t.Errorf("%s: no 10-day reminder", path)
}