Docs team mode: the native list under Unknown is unavailable, not short
The Mac and iPhone apps render no partial notice, so a shares-only list would read as the whole list. Fable's blocker on oficina/docs #100.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+34
−0
internal/docs/native.go+8 −0internal/docs/team_router_test.go+26 −0
CI passed — run details
diff --git a/internal/docs/native.go b/internal/docs/native.go| index 93197de..dbbfe42 100644 |
| --- a/internal/docs/native.go |
| +++ b/internal/docs/native.go |
| @@ -55,6 +55,14 @@ func (h *handlers) nativeList(w http.ResponseWriter, r *http.Request) { |
| } else { |
| documents, err = h.store.ListFor(r.Context(), actor) |
| } |
| + // The Mac and iPhone apps render no partial notice, so under Unknown |
| + // this list is unavailable rather than short, as the dashboard feed is |
| + // (Fable on oficina/docs #100). Asked after listing, from the same |
| + // Access. A "partial" field is the better contract once the clients |
| + // render it. |
| + if a, ok := r.Context().Value(accessContextKey{}).(*requestAccess); err == nil && ok && a != nil && a.Partial() { |
| + err = errTeamUnavailable |
| + } |
| if err != nil { |
| http.Error(w, rastrillo.T(r, "docs.error.generic"), h.internalFailureStatus()) |
| return |
diff --git a/internal/docs/team_router_test.go b/internal/docs/team_router_test.go| index 855915f..d87278f 100644 |
| --- a/internal/docs/team_router_test.go |
| +++ b/internal/docs/team_router_test.go |
| @@ -11,6 +11,7 @@ import ( |
| "io" |
| "log/slog" |
| "net/http" |
| + "net/http/httptest" |
| "net/url" |
| "path/filepath" |
| "strings" |
| @@ -402,6 +403,31 @@ func TestTeamRouterHomeOnlyFirstEntryUnderUnknownIsRetryable(t *testing.T) { |
| } |
| } |
| +// The native list renders no partial notice, so under Unknown it is |
| +// unavailable rather than a short list of shares (Fable on #100). |
| +func TestTeamNativeListUnderUnknownIsUnavailableNotShort(t *testing.T) { |
| + f := newTeamRouterFixture(t) |
| + b := f.browser() |
| + b.localSignin(t, "alice@example.com") |
| + b.linkProof(t, teamSubject('a'), "alice@example.com") |
| + routerRedirect(t, b.do("POST", "/account/home/confirm", ""), connectedURL("/")) |
| + native := func(path string) *httptest.ResponseRecorder { |
| + r := b.request("GET", path, "") |
| + r.Header.Set("Accept", "application/json") |
| + return b.serve(r) |
| + } |
| + if r := native("/"); r.Code != 200 || !strings.Contains(r.Body.String(), "Alice original") || !strings.Contains(r.Body.String(), "Bob shared") { |
| + t.Fatal("member native list", r.Code) |
| + } |
| + f.directory.change(nil, true) |
| + f.clock.step(61 * time.Second) |
| + for _, path := range []string{"/", "/?q=Bob"} { |
| + if r := native(path); r.Code != 503 || strings.Contains(r.Body.String(), "Bob shared") { |
| + t.Fatal("native list under Unknown was short, not unavailable", path, r.Code, r.Body.String()) |
| + } |
| + } |
| +} |
| + |
| // Under Unknown the list page is the partial list with the notice even when |
| // it is empty: the empty state and the notice, not a 503 (Paul's ruling on |
| // list pages, 2026-10-28). NotMember's empty list is complete, so it carries |