Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Handle CORS / Network problems #415

Closed

Description

@Ryuno-Ki

Describe the bug:

During work on #413 I observed CORS issues (localhost:3000 couldn't reach localhost:5000/graphql).
From what I can see, error cases on the network level are not properly handled in the UI.
#413 is showing a technical error message. However, a proper UI/UX spec should be defined what to do if data can't be loaded.

Tell us about your browser and operating system:

  • Browser(s) name and version: Firefox 78
  • Operating System: Sabayon Linux

Activity

  1. vkWeb commented on Oct 14, 2020

    @vkWeb
    Member

    @Ryuno-Ki As far as UI is concerned, if a client can't reach the backend then I think we should display a flash error message...?

  2. Ryuno-Ki commented on Oct 14, 2020

    @Ryuno-Ki
    ContributorAuthor

    Hi @vkWeb,

    there is no design spec for it (we can use issue to flash out one).
    „Flash error message” is something like a snackbar?

    Keep in mind WCAG Success Criterion 2.2.1: Timing Adjustable (Level A).

    If you want to read more about accessibility: https://adrianroselli.com/2020/01/defining-toast-messages.html and https://www.scottohara.me/blog/2019/07/08/a-toast-to-a11y-toasts.html are good starts.
    Material UI will take care of some aspects, so we can focus on the UX here.

  3. vkWeb commented on Oct 14, 2020

    @vkWeb
    Member

    @Ryuno-Ki I personally like how GitHub brings up flash message just below the navigation. It stays till dismissed by user. Snackbar might provide that functionality so let's go with it.

  4. Ryuno-Ki commented on Oct 14, 2020

    @Ryuno-Ki
    ContributorAuthor

    I think, GitHub's approach is closer to Alerts.

  5. vkWeb commented on Oct 14, 2020

    @vkWeb
    Member

    @Ryuno-Ki Perfect. Full-width and sticky just below navigation. What do you say?

  6. Ryuno-Ki commented on Oct 14, 2020

    @Ryuno-Ki
    ContributorAuthor

    I'd like to have #413 merged first :-)

    I need to think about how to trigger the Alert component. Ideally, that should be possible from different components (i.e. everywhere we use a GraphQL query for starters).

  7. vkWeb commented on Oct 14, 2020

    @vkWeb
    Member

    @Ryuno-Ki we should not merge without Tim's review. Let us wait, he'll check the PR after work.

    Can we create an errorHandler sort of thing. That puts up an alert whenever an API request fails...?

  8. Ryuno-Ki commented on Oct 14, 2020

    @Ryuno-Ki
    ContributorAuthor

    Sure thing. I'm not in a hurry.

    From my experience with React, I can imagine several approaches.
    If there were a state management like Redux or MobX, the Alert would be shown once a respective property is set in the state tree.
    Another approach would be to use a Context for that, but I will need to research, how well that would integrate with the current setup.
    The third option I can imagine is to pass callbacks down the tree via prop. I'd like to avoid this one if possible.
    Custom Events aren't listed under the supported events.

  9. added
    UI/UX
    on Dec 25, 2022
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

    UI/UX

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions