developmentseed / scoreboard

Encouraging OpenStreetMap mappers with badges, graphs & stats! ✨🕹
https://developmentseed.org/scoreboard
27 stars 9 forks source link

silent failure mode when osm-teams api is down #532

Open guidorice opened 4 years ago

guidorice commented 4 years ago

If osm-teams api is down, the app behaves badly when it tries to connect.

Teams page appearance when rendered server-side

Screen Shot 2020-03-25 at 8 16 37 AM

Teams page appearance when rendered client-side. It's kind of beside the point but these should not render differently (relates to #511)

Screen Shot 2020-03-25 at 8 20 27 AM

Partial stack trace from next.js

 error: Error: connect ECONNREFUSED 127.0.0.1:8989
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1134:16) {
    errno: 'ECONNREFUSED',
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 8989
  },
  options: {
    uri: 'http://localhost:8989/api/teams?osmId=10499924',
    callback: [Function: RP$callback],
    transform: undefined,
    simple: true,
    resolveWithFullResponse: false,
    transform2xxOnly: false
  },

Recommendation:

Display a toast or error dialog saying osm-teams could not be reached. This would enable at the minimum an admin to troubleshoot it (or communicate it to the devs).

kamicut commented 4 years ago

related issue https://github.com/developmentseed/scoreboard/issues/358