Skip to content

[Bug]: Table detail navigation fails for table names containing "#" or non-ASCII characters (i18n) #194

Description

@tadmas2020

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

  • Register a data source with a table whose name contains # (for example SALES#2026)
  • Run a scan and confirm it completes successfully
  • Confirm the table appears in the table list on the Source detail page
  • Click the table name link
  • The detail page does not open. The browser URL stops at .../tables/SALES and everything from #2026 onward 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.tsx

<Link
  onFollow={(e) => {
    e.preventDefault();
    navigate(
      `/namespaces/${namespaceId}/sources/${sourceId}/tables/${item.tableId}`,
    );
  }}
>
  {item.tableId}
</Link>

Two changes are needed.

  1. Encode tableId with encodeURIComponent.
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions