Repository navigation
fix(v6.50.3): anonymous relationship reads; hide comments UI for anonymous visitors (ADR-251) - #303
Merged
Merged
Conversation
…ymous visitors (ADR-251)
Product decisions (2026-09-24): listing relationships should not need
signing in, and anonymous visitors should not see the comments error.
Relationships:
- GET /api/relationships and GET /api/relationships/{id} now use
get_optional_user, like element reads (ADR-123). Writes unchanged; a
present-but-invalid token is still 401.
- Removes ADR-249's "relationship reads need sign-in" carve-out from the MCP
server instructions (seed + fallback), the list_relationships /
get_relationship descriptions, mcp/README.md and docs/api.md. Supersedes
ADR-249 rejected option (g); SPEC-249-A annotated.
Comments:
- Comment reads need sign-in, so anonymous visitors always got a "Failed to
load comments" panel (401). CommentsPanel now renders and fetches only
when signed in; the diagram page gates all four Comments toggles on
commentsAvailable = !isAnonymous() and skips the comment-count request.
Tests (TDD):
- backend TestAnonymousReads (anon list by element / set+type, get one;
bad token still 401; writes still 401) + seed-text assertion inverted:
4 red before, tests/test_relationships 46 passed after.
- mcp: sign-in assertions inverted; 276 passed, 2 failures pre-existing on
main (inventory required-fields tests).
- frontend unit anonymousCommentsHidden.test.ts: 6 red before, green after.
- e2e anonymous-readonly.spec.ts "no comments UI on a diagram": failed on
main's components (Comments button present), passes after; spec 5/5.
- Surface parity clean.
See docs/adrs/ADR-251-Anonymous-Relationship-Reads-And-Hidden-Comments.md and
docs/adrs/specs/SPEC-251-A-Anonymous-Relationship-Reads-And-Hidden-Comments.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EbTwcTX1wKVooS7oWd7cP9
cgbarlow
force-pushed
the
fix/anonymous-relationships-comments
branch
from
September 24, 2026 01:25
10cd1ef to
c0e7ce2
Compare
Owner
Author
|
Rebased onto main after #302 merged. Only the version files and CHANGELOG conflicted: [6.50.3] now sits above [6.50.2], and the version stays 6.50.3. Rechecked after the rebase: tests/test_relationships, test_authz and test_batch gave 98 passed; the full backend suite gave 2122 passed, with only the same 15 failures main has; the frontend anonymous-comments tests gave 6 passed; and the surface-parity check is clean. 🤖 Generated with Claude Code |
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.
Problem
GET /api/relationshipsandGET /api/relationships/{id}required sign-in, unlike element and diagram reads (ADR-123). So anonymous visitors and MCP sessions could see a model's elements but not how they connect, and ADR-249 had to carve these two tools out of the "reads work without sign-in" promise.Product decisions (2026-09-24): listing relationships should not need signing in, and the anonymous comments error should be hidden.
Fix
Relationships
get_optional_user, like element reads.mcp/README.mdanddocs/api.md.Comments
CommentsPanelonly renders and fetches when signed in.commentsAvailable = !isAnonymous()) and skips the comment-count request.Tests
TestAnonymousReadscovers anonymous list by element, anonymous list by set and type, and anonymous get-one. It also checks that an invalid token still gets 401 and that writes still get 401.tests/test_relationshipsnow has 46 passing.test_search(11), Sparx.eap(2) andtest_mnemos(2).anonymousCommentsHidden.test.ts: 6 tests, which failed before the change and pass after.anonymous-readonly.spec.tshas a new test, "anonymous visitor sees no comments UI on a diagram". It checks there's no Comments button, no "Failed to load comments" text and no/commentsrequest, and that the button returns after sign-in.Rollout
No migration. The MCP server-instructions seed text changes, the same way #300 changed it. #302 (v6.50.2) and #301 (v6.51.0) are in flight, so whichever merges later needs a small CHANGELOG and version rebase. #301 may also touch the same server-instructions paragraph.
ADR:
docs/adrs/ADR-251-Anonymous-Relationship-Reads-And-Hidden-Comments.mdSpec:
docs/adrs/specs/SPEC-251-A-Anonymous-Relationship-Reads-And-Hidden-Comments.md🤖 Generated with Claude Code
https://claude.ai/code/session_01EbTwcTX1wKVooS7oWd7cP9