Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a fallback config-file hard coded #208

Closed
wellemut opened this issue Apr 18, 2024 · 3 comments · Fixed by #209
Closed

Make a fallback config-file hard coded #208

wellemut opened this issue Apr 18, 2024 · 3 comments · Fixed by #209
Assignees
Labels
0 bug Something isn't working

Comments

@wellemut
Copy link
Member

Describe the bug
The Map App is stopping. One reason could be, that the config file cant get loaded,
Maybe the config file in the nextcloud is blocked by nextcloud, because the nextcloud is using/syncing the file.

But that is a bad implementation as an App should not crush completly, just because an API or a config file is not availiabl.

Solution:

Implement a hard codes version of the config file directly in the App, which gets loaded, if no other config file cant be found in a certain time.

Use the values from the main file for this implementation: https://www.kartevonmorgen.org/public/projects/main/config.json

To Reproduce
happens sometimes, you never know when...

Expected behavior
stable loading of the map-app. If an API or file is unavalible I expect a popup or an error message.

Screenshots
grafik

Additional context
The Backend got an update In the beginning of April, so the backend shouldnot be the reason for the bug.
Increasing the timeout is also part of the solution: #207

@navid-kalaei
Copy link
Collaborator

Summery of the done works

  • increased the API call timeout failed
  • read the config files directly from the server instead of making the API calls
  • if the config file for an specific map does not exist, tries to open the default config
  • even if the default config could not be found return the hard coded config
  • if for any reasons the json config files are broken, for example syntax error, then return the hard coded config
  • for any failure log the error for debugging

The error messages

  • api map config: failed to read config file for project
  • api map config: trying to read default config file
  • api map config: failed to read default config file
  • api map config: failed to parse config file for project

The hard coded config

{
    "map": {
      "location": {
        "lat": 50.8129,
        "lng": 5.6030,
        "zoom": 6
      },
      "colorStyle": MapColorModes.GRAY
    },
    "popularTags": {
      "min_count": 2
    },
    "sidebar": {
      "title": "Kartevonmorgen"
    }
  }

@wellemut wellemut linked a pull request May 24, 2024 that will close this issue
@wellemut wellemut assigned alex0107 and unassigned navid-kalaei May 28, 2024
@wellemut
Copy link
Member Author

@wellemut wellemut assigned wellemut and unassigned alex0107 May 28, 2024
@wellemut
Copy link
Member Author

It seems, that all instabilities are solve https://status.rhw24.it/status/allgemein

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants