Description
Clicking a table name in the table list does not open the detail page. This happens when the table name contains #, other URL-reserved characters, or non-ASCII characters. The scan itself succeeds and the table appears in the list.
Environment
- Commit ID: Observed on
42b5c6b (tag v0.2.2). The code is still unchanged on e265573 (tag v0.3.1 = main).
- Environment: ap-northeast-1 deployment
Step to reproduce
A root cause
The navigation URL is built from the raw tableId. # is interpreted as the start of a URL fragment, so the path is cut there and no longer matches the React Router route /namespaces/:namespaceId/sources/:dataSourceId/tables/:tableId.
packages/web-app/src/pages/SourceDetail.tsx
<Link
onFollow={(e) => {
e.preventDefault();
navigate(
`/namespaces/${namespaceId}/sources/${sourceId}/tables/${item.tableId}`,
);
}}
>
{item.tableId}
</Link>
Two changes are needed.
- Encode
tableId with encodeURIComponent.
- Extract the URL construction into a helper. There is only one such call site today, but the same omission will recur once more navigation paths are added.
const tableDetailPath = (
namespaceId: string,
sourceId: string,
tableId: string,
): string =>
`/namespaces/${encodeURIComponent(namespaceId)}` +
`/sources/${encodeURIComponent(sourceId)}` +
`/tables/${encodeURIComponent(tableId)}`;
navigate(tableDetailPath(namespaceId!, sourceId!, item.tableId!));
Both the useParams return values and TableSummary.tableId are optional, so the call site takes the same shape as the existing code in this file that passes namespaceId! / sourceId! / t.tableId! to ReviewSourceTableCommand.
Context
The API side already decodes path parameters: _route() in sources_handler.py unquotes pathParameters in one place (its comment uses db.商品マスタ as the example). The UI-side encodeURIComponent is the counterpart, and only the UI side is missing.
Risks & Known Unknowns
- Existing bookmarked URLs are essentially unaffected. Un-encoded URLs never worked for tables containing
# in the first place.
- API calls are encoded independently by the Smithy client (
GetSourceTableCommand) and unquoted on the Lambda side. That path is separate from the browser URL, so double encoding is not expected, but this needs verification on a live deployment.
Additional Information / References
Description
Clicking a table name in the table list does not open the detail page. This happens when the table name contains
#, other URL-reserved characters, or non-ASCII characters. The scan itself succeeds and the table appears in the list.Environment
42b5c6b(tagv0.2.2). The code is still unchanged one265573(tagv0.3.1=main).Step to reproduce
#(for exampleSALES#2026).../tables/SALESand everything from#2026onward is treated as a fragment.A root cause
The navigation URL is built from the raw
tableId.#is interpreted as the start of a URL fragment, so the path is cut there and no longer matches the React Router route/namespaces/:namespaceId/sources/:dataSourceId/tables/:tableId.packages/web-app/src/pages/SourceDetail.tsxTwo changes are needed.
tableIdwithencodeURIComponent.Both the
useParamsreturn values andTableSummary.tableIdare optional, so the call site takes the same shape as the existing code in this file that passesnamespaceId!/sourceId!/t.tableId!toReviewSourceTableCommand.Context
The API side already decodes path parameters:
_route()insources_handler.pyunquotespathParametersin one place (its comment usesdb.商品マスタas the example). The UI-sideencodeURIComponentis the counterpart, and only the UI side is missing.Risks & Known Unknowns
#in the first place.GetSourceTableCommand) and unquoted on the Lambda side. That path is separate from the browser URL, so double encoding is not expected, but this needs verification on a live deployment.Additional Information / References