Skip to content

chore(api): delete five unwired endpoints and guard against new ones - #90

Merged
Adron merged 2 commits into
mainfrom
chore/apiclient-dead-endpoint-sweep
Sep 17, 2026
Merged

Adron merged 2 commits into
mainfrom
chore/apiclient-dead-endpoint-sweep

Conversation

@Adron

@Adron Adron commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

Closes #64. Re-ran the zero-call-site sweep now that #47, #50 and #52 have landed. Those three did
wire their endpoints (muteUser, trashDM/restoreDM, addOrganizationMember/joinOrganization
all have view call sites). What remained was genuinely vestigial.

Sweep result

Transport helpers (get, post*, put*, patch*, delete*, checkResponse,
postMultipartRawData, pathSegment, serverErrorMessage) are called via Self. inside the client
and were excluded, as the issue specifies.

Function Disposition Why
organizations(limit:offset:) deleted Superseded by userOrganizations() and publicOrganizations(limit:offset:), both wired by #52.
githubIssues(repo:state:) deleted GitHub-backed rows come through the /api/lists/:id/data proxy, which is the correct path. Vestigial, as the issue suspected.
updateListSchema(listId:schemaDSL:) deleted The DSL variant. ListSchemaEditorView saves via updateListSchemaStructured.
directMessage(id:) deleted (new find, not on the issue's list) Nothing addresses a DM by id — the UI opens threads by username.
markDMRead(id:) deleted (new find) Opening a thread marks it read server-side (app/api/dm/thread/[username]/route.ts:31), so a per-message mark-read is redundant.
refreshMessageMetadata(messageId:) kept, documented Wiring it means a request on the publish path (the web fires it after publish — MessageInput.tsx:511). That is a behaviour change to the most important path in the app, so it is tracked separately rather than slipped into a hygiene sweep.
verifyIdentity(provider:providerId:) kept, documented It is the only route that reports real token health. The five /status routes report whether a provider is configured server-side, not whether this account's token still works — which is why LinkedIdentitiesView cannot show a "reconnect needed" state. Deleting it would throw away the primitive that closes that gap.

Both survivors now carry a comment saying why they are kept, satisfying the acceptance criterion
that no zero-call-site function is left unexplained.

Guarding against the next one

Added to /ios-review:

Testing

  • xcodebuild … -parallel-testing-enabled NO -skip-testing:InterlinedListTests/E2EReadOnlyTests test
    1132 tests, 0 failures. Down 15 from main: the 11-test APIClientUpdateListSchemaTests file
    (deleted and deregistered from project.pbxproj) plus 4 individual tests for the other removals.
  • No behaviour change: nothing deleted had a call site.

Note for reviewers

This PR is cut from main, so it does not know about the endpoints added in the in-flight PRs
(#83 seedDefaultDocumentTemplates, #84 crossPostReplyCounts, #86 dmConversations,
#88 documentPresence, #89 the app-settings routes). All of those are wired to a screen — I checked
as each was written — but the sweep is worth re-running once they merge.

🤖 Generated with Claude Code

An APIClient function no screen calls reads as coverage in an endpoint diff
while being a missing feature — how "shared with me", mute, add-org-member and
trash-a-DM stayed invisible. Re-ran the sweep now that #47, #50 and #52 have
landed; those three are wired, and what remained was genuinely vestigial.

Deleted, with their tests:
- `organizations()` — superseded by `userOrganizations()` and
  `publicOrganizations()`, both wired by #52
- `githubIssues(repo:state:)` — GitHub rows come through the
  /api/lists/:id/data proxy, which is the correct path
- `updateListSchema(listId:schemaDSL:)` — the DSL variant, superseded by
  `updateListSchemaStructured`
- `directMessage(id:)` — nothing addresses a DM by id; the UI opens threads by
  username
- `markDMRead(id:)` — opening a thread marks it read server-side

Kept, now with a comment saying why rather than sitting there unexplained:
- `refreshMessageMetadata` — wiring it adds a request to the publish path, so
  it is tracked separately rather than slipped into a hygiene sweep
- `verifyIdentity` — the only route reporting real token health; the /status
  routes report provider configuration, not whether this account's token works

Added the sweep and a payload-key check to /ios-review so the next one is
caught at review time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bss5MgZa7Jvj2m9zdaUd1
Conflict confined to project.pbxproj; both sides were pure additions to the
Sources build phases, so both were kept. Integrity verified: no undeclared
Sources entry, no dangling fileRef, no duplicate object definitions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bss5MgZa7Jvj2m9zdaUd1
@Adron
Adron merged commit 3118542 into main Sep 17, 2026
1 check passed
@Adron
Adron deleted the chore/apiclient-dead-endpoint-sweep branch September 17, 2026 08:40
Adron added a commit that referenced this pull request Sep 17, 2026
One conflict, in APIClient.swift: this branch adds the `queryValueAllowed`
character set used by `unlinkIdentity`, and #90 (the dead-endpoint sweep, now on
main) added a doc comment above `verifyIdentity` at the same point. Both kept,
in that order, so the doc comment stays attached to the function it documents —
verified after resolving.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bss5MgZa7Jvj2m9zdaUd1
Adron added a commit that referenced this pull request Sep 17, 2026
One conflict, in APIClient.swift, resolved by taking this branch's version
rather than keeping both: #90 (now on main) added a doc comment to the old
two-argument `verifyIdentity(provider:providerId:)`, and this branch replaces
that function outright with `verifyIdentity(provider:)` returning an
`IdentityVerification` outcome. Main's copy is the version this supersedes, so
keeping both would have left a stale duplicate and a signature that no longer
compiles against the call site.

Verified after resolving: only the single-argument form remains, and no
`providerId` parameter survives anywhere in the file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bss5MgZa7Jvj2m9zdaUd1
Adron added a commit that referenced this pull request Sep 17, 2026
One conflict, in APIClient.swift, resolved by taking this branch's version.
Main carries the "No caller yet, deliberately" note #90 added to
refreshMessageMetadata; that became stale the moment #94 wired the call from
ComposeView, and this branch replaces it with a comment describing the route's
actual response shape. Keeping both would have restated a claim the code now
contradicts.

Verified after resolving: the stale note is gone, the decode reads top-level
`links` as required, and MessageLinkPreview has no remaining references.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bss5MgZa7Jvj2m9zdaUd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

W8: Sweep APIClient for endpoints no screen calls

1 participant