Skip to content

UHF-11460: Fix timeout messaging in events app#1230

Merged
jeremysteerio merged 4 commits intomainfrom
UHF-11460
Apr 1, 2025
Merged

UHF-11460: Fix timeout messaging in events app#1230
jeremysteerio merged 4 commits intomainfrom
UHF-11460

Conversation

@jeremysteerio
Copy link
Contributor

@jeremysteerio jeremysteerio commented Mar 26, 2025

UHF-11460

Fix timeout problems in event search

What was done

  • Add retriesExhausted state
  • Show error message only after all retries are unsuccesful
  • Add custom message option to error component
  • Add translations

How to install

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the HDBT theme
    • composer require drupal/hdbt:dev-UHF-11460
  • Run make drush-cr

How to test

Need to do some code changes to test this:

  • cd public/themes/contrib/hdbt
  • nvm use; npm i; npm run dev
  • in src/containers/SearchContainer change the 3rd argument of useTimeoutFetch from 10 000 to 1000.

Then test out the app:

  • Create or edit a event list paragraph
  • Check what happens in the network tab when event list is making request to linkedevents api. Unless the requests are very light, you should see 3 aborted requests and the page should display an error message.
  • If the request are going through, change the argument from 1000 to even lower until the requests fail
  • Note requests get cached and might go through if you reload the same page -> you can circumvent this just by changing the page from the pager
  • During this process, you should not see the error message before all retries have been exhausted (ie. three failing request are shown in the network tab)

Continuous documentation

  • This feature has been documented/the documentation has been updated
  • This change doesn't require updates to the documentation

Translations

  • Translations have been added to .po -files and included in this PR

Other PRs

  • Link to other PR

@jeremysteerio jeremysteerio marked this pull request as ready for review March 27, 2025 06:45
@github-actions
Copy link

✅ Tests passed! You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt-visual-regression/pull/1230/html_report/

@github-actions
Copy link

✅ Tests passed! You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt-visual-regression/pull/1230/html_report/

Copy link
Contributor

@teroelonen teroelonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works very nicely! I made a small adjustment on the loading spinner since it has been bothering me for so long 🦖

@github-actions
Copy link

github-actions bot commented Apr 1, 2025

✅ Tests passed! You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt-visual-regression/pull/1230/html_report/

@jeremysteerio jeremysteerio merged commit cf8dbc9 into main Apr 1, 2025
2 checks passed
@jeremysteerio jeremysteerio deleted the UHF-11460 branch April 1, 2025 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants