···136136137137 defp parse_limit(%{"limit" => limit_str}) do
138138 case Integer.parse(limit_str) do
139139- {limit, ""} when limit >= 1 and limit <= 100 -> {:ok, limit}
140140- _ -> {:error, "limit must be an integer between 1 and 100"}
139139+ {limit, ""} when limit >= 1 and limit <= 1000 -> {:ok, limit}
140140+ _ -> {:error, "limit must be an integer between 1 and 1000"}
141141 end
142142 end
143143
+6-6
appview/test/atvouch/xrpc_vouches_test.exs
···189189 assert conn.status == 400
190190 end
191191192192- test "returns 400 with limit over 100" do
192192+ test "returns 400 with limit over 1000" do
193193 conn =
194194- conn(:get, "/xrpc/dev.atvouch.graph.getCurrentUserVouches?limit=101")
194194+ conn(:get, "/xrpc/dev.atvouch.graph.getCurrentUserVouches?limit=1001")
195195 |> put_req_header("authorization", "Bearer valid-token:did:plc:alice")
196196 |> Atvouch.Router.call(@opts)
197197···396396 assert conn.status == 400
397397 end
398398399399- test "returns 400 with limit over 100" do
399399+ test "returns 400 with limit over 1000" do
400400 conn =
401401- conn(:get, "/xrpc/dev.atvouch.graph.getRemoteVouches?limit=101")
401401+ conn(:get, "/xrpc/dev.atvouch.graph.getRemoteVouches?limit=1001")
402402 |> put_req_header("authorization", "Bearer valid-token:did:plc:alice")
403403 |> Atvouch.Router.call(@opts)
404404···538538 assert conn.status == 400
539539 end
540540541541- test "returns 400 with limit over 100" do
541541+ test "returns 400 with limit over 1000" do
542542 conn =
543543- conn(:get, "/xrpc/dev.atvouch.graph.getEntireGraph?limit=101")
543543+ conn(:get, "/xrpc/dev.atvouch.graph.getEntireGraph?limit=1001")
544544 |> Atvouch.Router.call(@opts)
545545546546 assert conn.status == 400
+25-8
frontend/src/App.tsx
···191191 setVouchesLoading(true);
192192 setVouchesError(null);
193193 try {
194194- const result = await listVouches(agent);
195195- setVouches(result.vouches);
196196- setVouchesTotal(result.total);
197197- setVouchesCursor(result.cursor);
194194+ let allVouches: VouchEntry[] = [];
195195+ let cursor: string | undefined;
196196+ let total = 0;
197197+ do {
198198+ const result = await listVouches(agent, { limit: 1000, cursor });
199199+ allVouches = [...allVouches, ...result.vouches];
200200+ total = result.total;
201201+ cursor = result.cursor;
202202+ } while (cursor);
203203+ setVouches(allVouches);
204204+ setVouchesTotal(total);
205205+ setVouchesCursor(undefined);
198206 } catch (err) {
199207 setVouchesError(String(err));
200208 }
···428436 setLoading(true);
429437 setError(null);
430438 try {
431431- const result = await fetchRemoteVouchers(agent);
432432- setVouchers(await resolveVouches(result.vouches));
433433- setTotal(result.total);
434434- setCursor(result.cursor);
439439+ let allVouches: RemoteVoucher[] = [];
440440+ let pageCursor: string | undefined;
441441+ let total = 0;
442442+ do {
443443+ const result = await fetchRemoteVouchers(agent, { limit: 1000, cursor: pageCursor });
444444+ const resolved = await resolveVouches(result.vouches);
445445+ allVouches = [...allVouches, ...resolved];
446446+ total = result.total;
447447+ pageCursor = result.cursor;
448448+ } while (pageCursor);
449449+ setVouchers(allVouches);
450450+ setTotal(total);
451451+ setCursor(undefined);
435452 } catch (err) {
436453 setError(String(err));
437454 }