Skip to content

Improve handling of server errors when loading the Record Page #2081

@seancolsen

Description

@seancolsen

The Record Page has a few places where we make API requests and don't adequately handle server errors:

  • Here

    $: record = new RecordStore({ table, recordId });

    The RecordStore constructor calls RecordStore.fetch which fetches the record data. If this fails, then the page loads, giving the user the impression that all fields in the record are blank.

  • Here

    $: tableStructure = new TableStructure({
      id: table.id,
      abstractTypesMap: $currentDbAbstractTypes.data,
    });

    The TableStructure constructor instantiates other stores which fetch data within their constructors.

  • Here

    {#await getJoinableTablesResult(table.id)}
      <RecordPageLoadingSpinner />
    {:then joinableTablesResult}
      <Widgets {joinableTablesResult} {recordId} recordSummary={$summary} />
    {/await}

    The getJoinableTablesResult function might throw an error. We should handle this. We should also eliminate code duplication with the getJoinableTablesResult function in src/stores/tables.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    readyReady for implementationrestricted: maintainersOnly maintainers can resolve this issuetype: bugwork: frontendRelated to frontend code in the mathesar_ui directory

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions