Timeout to get location using Social GeoLocation

Created on 17 July 2024, 4 months ago
Updated 2 August 2024, 4 months ago

Problem/Motivation

When an user are being register and the Social GeoLocation module is enable, sometimes an unexpected error happen and registration stop.
The Social GeoLocation module get localtion using Nominatim and when it has any unavailability, the error happen.

Steps to reproduce

To reproduce the error, we need to force the error, because it only happen when the Nominatim has unavailability.

  • Replace code at: '/modules/geolocation_leaflet/src/Plugin/geolocation/Geocoder/Nominatim.php:36' with code below
  • Enable Social Geo Location
  • Logged with Site Manager user
  • Create an user using page: /admin/people/create
  • An unexpected error will broken the register page
    $request_url_base = 'https://httpstat.us/200';
    $url = Url::fromUri($request_url_base . '/search?q=' . $address, [
      'query' => [
        'sleep' => 50000,
        'email' => $this->getRequestEmail(),
        'limit' => 1,
        'format' => 'json',
        'connect_timeout' => 5,
      ],
    ]);

Proposed resolution

The Geo Location isn't be mandatory and can't broken the register, so add a treatment to return a warning message to inform the user about empty location and continue with registration.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇧🇷Brazil viniciusrp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024