Commit 38b20aa
fix(model-apps): paginate the role-privilege read instead of capping at 5000
Found by a LIVE run against a real environment, which is the only place it could
have shown up: with `top: 5000`, reading a System Administrator role returned
EXACTLY 5000 rows. Paginated, the same role returns 7119 -- so 2119 privileges,
30% of the role, were being silently dropped.
A truncated page is the worst possible shape for this check. `compareRolePrivileges`
asks whether the role holds each DECLARED privilege; a privilege that merely fell
off the end of page one is indistinguishable from one the role does not hold, so
verify reports a correctly configured role as MISSING privileges. Same cry-wolf
class as the two earlier fixes in this PR, but this one is silent: nothing in the
response says the list was cut short.
Follows @odata.nextLink to completion instead, matching what fetchAppsForPages
already does for the same reason. Deliberately NOT combined with `top`: Dataverse
honors $top as a hard cap and omits @odata.nextLink when it is present, and the
SDK rejects paginate+top for exactly that reason -- so asserting the ABSENCE of
top matters as much as asserting pagination.
Cost is not a concern: the paginated read of 7119 rows completed in 692ms.
Red-green verified; restoring `top: 5000` fails the new test. CI could not have
caught this -- every unit test stubs queryRecords and returns a short list, so the
cap was invisible until a real role exceeded it. The test now pins the query
OPTIONS rather than the result, which is the part a stub cannot fake.
1486 tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 42626da2-b66f-4162-acaa-b1127ef23d891 parent 955b2b9 commit 38b20aa
2 files changed
Lines changed: 28 additions & 1 deletion
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
0 commit comments