Repository navigation
Commit 1354e3e
fix(app-shell): a record discussion the row budget declines is not shown as empty (#39287)
Fixes #39272
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
在只设了单次读取行数上限、没设分页大小的部署上,评论数超过上限的记录:记录页评论面板、列表页评论和手机评论页以前显示「还没有评论」,现在显示已有的「无法加载此记录的评论」提示,评论图标不再显示数字。
- 属于记录评论专题,替在这类部署上查看评论的用户解决「以为没人留言」的误导。
- 只影响评论读取被行数上限拒绝的那一种情况;出错时最坏是该提示多显示,改动可直接撤回。
- 无
## What changes
On a deployment with a row budget (`OS_DATA_QUERY_ROW_BUDGET`) and no
page size, a record's discussion is one unpaged read, and a record with
more comments than the budget is refused `400
QUERY_ROW_BUDGET_EXCEEDED`. `feedReadVerdictOf` mapped that first-page
400 to `answered`, so `readComments` recorded an answered read with no
rows and every discussion surface drew "No comments yet" (premise
re-read on `main` at ee2be20: holds).
- `ui/packages/app-shell/src/views/useRecordDiscussion.ts`: a fourth
`FeedReadVerdict`, `declined`, for the row budget's refusal, named by
the server's code (read through `answeredLoadFailure`, so a code the
client lifts and a code parked in the envelope both count). Any other
400 stays `answered`. `readEveryPage` still ends paging on a LATER page
the budget declines, so the pages read stand as before.
- The panel components that render the discussion's empty / failed state
(named in this body at PR creation, after the edits, not before them as
the claim asked; L1 found the files within the claim's delegation): the
two hosts that turn the verdict into the panel's
`DiscussionContextProvider` props.
- `RecordDetailView.tsx` (record page): `commentsFailed` is true for
`declined` as for `failed`; the header comments icon names no count; no
Retry (it would send the same read).
- `objectViewCommentsShared.tsx` (list-page comments column and phone
comments page): `commentsFailed` true for `declined`, no Retry.
- Wording: no new text. The panel reuses its existing failure notice,
`detail.commentsLoadFailed` ("We couldn't load the comments for this
record."), drawn by plugin-detail's `CommentsPanel` / `CommentsPage`,
which are unchanged. The Retry button there is only drawn when the host
passes `onRetryFeed`, which stays `failed`-only.
- Reactions (decided: out, no signal). A reaction read the budget
declines is caught and the comments show without reactions, exactly as a
failed (5xx) reaction read already does. A signal would need new
user-facing wording with no precedent in the panel (there is no
reactions-could-not-load key), so it is not added here; a test pins the
current behaviour.
## Tests
Run at 376f45c, from `ui/` under the shared verify lock: `pnpm exec
vitest run --maxWorkers=2` over the three files below. Result: `Test
Files 3 passed (3)`, `Tests 44 passed (44)`.
- `useRecordDiscussion.test.tsx`, new describe: a first-page budget
refusal records `declined` with no rows and one read. CONTROL: any other
400 stays answered. A budget-declined reaction read keeps the comments
without reactions.
- `RecordDetailView.feedLoadFailure-29188.test.tsx` (the record page's
shared failure harness, through the real `ObjectStackAdapter`), new
describe:
- a declined page-payload discussion part shows the failure note with no
Retry and no icon count;
- a direct `sys_comment` GET answering `400 QUERY_ROW_BUDGET_EXCEEDED`
shows the same note. This case shows that the real client carries the
code.
- `ObjectView.phoneCommentsPage-39086.test.tsx` (phone page harness),
new describe: with a row budget smaller than the discussion and no page
size, the page says the comments could not be loaded, draws no empty
state and no Retry, and does not judge the linked thread gone. The
harness's budget refusal now carries the server's `code`, so the
existing later-page case (#39195) runs through the new `declined` branch
of `readEveryPage` and stays green.
<details><summary>Ablation (feedReadVerdictOf's declined line replaced,
via scripts/ablation-replace.mjs)</summary>
```
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 41804c2 -> bc1c76cbfce4
× a declined discussion part shows the load-failure notice, no Retry, no count
× a declined direct sys_comment read shows the same notice
× records a comment read the row budget declines as declined, not as answered with no rows
× says the comments could not be loaded, with no Retry, and stays on the thread
Test Files 3 failed (3)
Tests 4 failed | 40 passed (44)
ablation-replace: ok restored: blob == HEAD (41804c2) and `git diff HEAD` is empty
```
</details>
<details><summary>Type-check and gates</summary>
- `pnpm --filter @object-ui/app-shell type-check` (both `tsc --noEmit`
and `tsconfig.test.json`): exit 0, 0 errors.
- `dispatch-gates --ran`: `39 derived famil(ies) accounted for — 37 run,
2 NOT-MEASURED`. All 37 that were run exited 0.
- NOT MEASURED, left to CI: `pnpm --dir ui exec vitest run scripts/` (no
`ui/scripts` file touched) and `pnpm check:query-options-erasure`. Both
are timeout kills on the shared box (exit 124), not gate refusals.
- `overlap-check.mjs`: `VERDICT clean exit 0` against origin/main
d0c7b71, with 0 open PR heads sharing a file.
</details>
## Acceptance notes
- The `sys_activity` read shares `feedReadVerdictOf`, so an activity
read the budget declines now records `declined` too. The activity panel
maps only `refused` / `failed`, so what it draws is unchanged. Its reads
are `$top`-bounded windows, so the budget reaches them only when it is
below that window. This is not wired, and it is not filed.
- A comment re-read that later answers clears `declined`, as it clears
`refused` / `failed`.
## Verification
Files to read first, ordered by risk:
1. `useRecordDiscussion.ts`: `feedReadVerdictOf` and the `readEveryPage`
break.
2. `RecordDetailView.tsx`: the `commentsCount` and `commentsFailed`
hunks.
3. `objectViewCommentsShared.tsx`.
Two-minute check: `cd ui && pnpm exec vitest run
packages/app-shell/src/views/RecordDetailView.feedLoadFailure-29188.test.tsx
-t 39272`. Expect 2 passed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6Ca2yTZZiHWkyVgD2oK)_
<!-- signed: repo:objectstack@os-bill · os-bill ·
session_01Utp6Ca2yTZZiHWkyVgD2oK -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 22f2639 commit 1354e3e
7 files changed
Lines changed: 200 additions & 18 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
178 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
| |||
185 | 192 | | |
186 | 193 | | |
187 | 194 | | |
188 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
189 | 199 | | |
190 | 200 | | |
191 | 201 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 202 | + | |
195 | 203 | | |
196 | 204 | | |
197 | 205 | | |
| |||
488 | 496 | | |
489 | 497 | | |
490 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
110 | 121 | | |
111 | 122 | | |
112 | 123 | | |
| |||
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
165 | | - | |
| 176 | + | |
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
| |||
395 | 406 | | |
396 | 407 | | |
397 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
398 | 446 | | |
399 | 447 | | |
400 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3471 | 3471 | | |
3472 | 3472 | | |
3473 | 3473 | | |
3474 | | - | |
| 3474 | + | |
3475 | 3475 | | |
3476 | 3476 | | |
3477 | | - | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
3478 | 3480 | | |
3479 | 3481 | | |
3480 | 3482 | | |
| |||
5176 | 5178 | | |
5177 | 5179 | | |
5178 | 5180 | | |
5179 | | - | |
| 5181 | + | |
| 5182 | + | |
| 5183 | + | |
5180 | 5184 | | |
5181 | 5185 | | |
5182 | 5186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
0 commit comments