This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 1263e40
fix(app-shell,plugin-detail): the record activity panel says "no permission to view activity" when its read is refused, instead of an empty list (objectui#11195) (#11217)
Fixes #11195
Clause-②: yes (widening)
## What was wrong
An invited member of a hosted AI-built app opened a record
(objectstack-ai/cloud#2485). The server refused the record's
`sys_activity` read with a 403, and the activity panel showed an empty
list with no message. The member could not tell "no activity" from "not
allowed to see activity".
Every feed read ended in a catch that treated any failure as an empty
answer:
- `RecordDetailView` (the console record page): both feed reads,
`sys_activity` and `sys_comment`, ended in an empty `.catch` handler,
and `Promise.allSettled` then counted the failed read as answered. A 403
landed on "No comments yet".
- `record:activity` (plugin-detail): the self-fetch's `.catch` set the
feed to `[]` for every failure, so a 403 landed on "No activity
recorded".
## What changed
- **One verdict, reused.** `isRefusedFeedRead(err)` in plugin-detail's
`recordActivityFeed.ts`, exported from the package barrel beside
`activityRowToFeedItem`. It is the `forbidden` and `unauthorized` kinds
of the existing `classifyLoadError` read classifier
(`@object-ui/react`), and it reads no status or code of its own. Both
surfaces call it.
- **`RecordDetailView` keeps a verdict per source.** Each read records
"refused or not" under the same per-record key the rows use
(`feedRefusalByRecord`), so a refusal on one record never reaches
another. An answered read clears it. The host passes `activityDenied` /
`commentsDenied` on its `DiscussionContextProvider`.
- **`DiscussionContext`** (`@object-ui/react`) gains the two optional
members `activityDenied` / `commentsDenied`, in the provider's memo list
as primitives.
- **`record:activity`** records its self-fetch's refusal in state beside
`fetched`. With a host context it shows the host's two flags instead.
Host `items` carry no refusal.
- **`record:chatter` / `record:discussion`** pass the context's flags
through `RecordChatterPanel` to the timeline.
- **`RecordActivityTimeline`** takes `activityDenied` /
`commentsDenied`. With no rows, a refusal replaces the empty state: a
lock and a left-aligned sentence, not the centred inbox glyph. With rows
on screen, the rows stay and the notice sits above them. Only the i18n
sentence is rendered: no status, no server message, no object name.
- **Strings:** `detail.activityAccessDenied` and
`detail.commentsAccessDenied`, in all ten locale packs and in
`DETAIL_DEFAULT_TRANSLATIONS`. No existing key fit:
`attachmentsAccessDenied` names attachments.
- Changeset: `minor` for plugin-detail and react, which gain published
surface (plugin-detail's root export `isRefusedFeedRead` and the
optional `activityDenied` / `commentsDenied` on
`RecordActivityTimelineProps` / `RecordChatterPanelProps`; react's
`DiscussionContextValue` gains the same two optional members); `patch`
for app-shell and i18n. The `record:activity` section of the
plugin-detail guide gains "When the read is refused".
## Decisions the card left open, and what this PR does
- **A refused `sys_comment` beside an answered `sys_activity`.** The
comment half of the same panel gets the same treatment. The activity
rows stay on screen, and the notice above them reads "You don't have
permission to view comments on this record." Both refused, with no rows,
shows both lines.
- **401 counts as refused**, per the triage on the card (any refused
read: 401 / 403, or a permission envelope). This differs on purpose from
`RecordAttachmentsPanel`, whose `denied` state does not claim a 401. The
verdict's docblock records why.
- **Not refused, so the empty state stays:** a 200 with zero rows; a 404
(the ObjectStack adapter already answers a bare 404 as zero rows;
another adapter's 404 classifies as `network`); `OBJECT_API_DISABLED` /
`OBJECT_API_METHOD_NOT_ALLOWED` (`api-disabled`: a property of the
object, not of the caller); a 400; a 500. The panel has no error state,
so a 500 still settles on the empty state. See Acceptance notes.
- **No retry.** A refusal is written into state. No effect dependency
moves with it, and nothing re-issues the read. Both surfaces pin this.
## Verification (head `df5a91cb4`, after merging `origin/main` at
`9419df198`)
- New pins, both surfaces: `RecordDetailView.feedRefusal-11195.test.tsx`
(7 tests) and `record-activity.refusedRead-11195.test.tsx` (10 tests).
They cover: a 403 envelope and a 401 show the no-permission state with
no retry; the 200-zero-rows control shows the empty state; a 404 and a
500 do not show "no permission"; a refused comment read keeps the
activity rows; the host-context path; and the verdict's refused and
not-refused sets.
- Merged tree, one run: all `RecordDetailView*` suites, the
`record-activity*` / `record-chatter*` renderer suites,
`all-locales-key-parity`, `en-zh-key-parity` and
`defaults-maps-mirror-en-pack`: **49 files, 355 tests passed**.
- Before the merge (branch head `2fbe2df5f`): `packages/plugin-detail/`
whole: 226 files passed (1 skipped), 2245 tests passed. The
`RecordDetailView*` suites plus `defaults-maps-mirror-en-pack`,
`widget-dom-leak-sweep`, `palette-discussion-alias`, apps/console
`record-block-record-reach` and `packages/react/src/context`: 57 files,
653 tests passed. `packages/i18n/` whole: 74 files passed, 1216 tests
passed (13 skipped).
- `type-check`: `@object-ui/plugin-detail`, `@object-ui/app-shell`,
`@object-ui/react` and `@object-ui/i18n` all exit 0 (dependency closure
built first, `@object-ui/app-shell^...`).
- `eslint` on the 21 changed ts/tsx files: 0 errors.
- Gates, exit 0: `check-changeset-presence` (1 changeset, 4 released
packages), `check:control-bytes`, `check:new-line-citations` (0 new),
`check:i18n-keys`, `check:i18n-drift` (2 keys added, 0 en values
changed), `check:i18n-dead-keys`, `check:changeset-claims`,
`check:pending-changeset-literals`, `markdown-test-inputs --audit`,
`check:doc-types`, `check:doc-fences`, `check:doc-example-ids`,
`check:phantom-deps`, `check:self-import`, `check:test-path-roots`,
`check:vi-mock-specifiers`.
- NOT MEASURED: `check:doc-snippets` / `check:doc-examples` (exit 2,
precondition not met: packages outside this diff's closure are unbuilt;
the docs edit adds prose and no code fence). The root
`scripts/__tests__/` suite was not run: the shared verify lock queued
for over an hour. This diff edits no script and adds no test that reads
markdown. CI runs it.
## Ablation (one leg, at the shared verdict, head `df5a91cb4`)
`isRefusedFeedRead` was made to answer "not refused" for every
rejection, which turns a refusal back into the empty list on both
surfaces. The mutation went through `ablation-replace.mjs`: the anchor
was hit 1 time and went to 0, the marker went from 0 to 1, and the blob
changed. The subject reaches the tests through the vitest source alias
for `@object-ui/plugin-detail`, so no build sat in between.
- Mutated: **8 failed, 9 passed (17)**. The 8 red: the 403 and 401 pins
and the no-retry pin on each surface, the refused-comment pin, and the
verdict's refused set. The 9 green are the 200 / 404 / 500 controls on
both surfaces, the two host-context pins, and the verdict's not-refused
set. That is the expected direction.
- Restored: the blob equals the HEAD blob and `git diff HEAD` is empty.
## Acceptance notes (not filed; observations only)
- A read that fails without a refusal (a 500, an unreachable server)
still renders the empty state, "No comments yet" / "No activity
recorded". That sentence is a claim about the record, made without
evidence. The panel has no error state; `RecordAttachmentsPanel`'s
`unavailable` state is the house shape for one. The triage said this
case "is reported"; it is out of this card's scope.
- `DiscussionContextValue.error` is declared, but no host sets it and no
renderer reads it.
- When the `sys_comment` read is refused, the comment composer still
renders. Whether the member may WRITE a comment they may not READ is a
server question; this PR does not change the composer.
---
_Generated by [Claude
Code](https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ed498ac commit 1263e40
23 files changed
Lines changed: 779 additions & 17 deletions
File tree
- .changeset
- content/docs/plugins
- packages
- app-shell/src/views
- i18n/src/locales
- plugin-detail/src
- renderers
- __tests__
- react/src/context
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
221 | 236 | | |
222 | 237 | | |
223 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
0 commit comments