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

Fix: Fallback for getOSName #1324

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Fix: Fallback for getOSName #1324

merged 1 commit into from
Nov 29, 2024

Conversation

dennypradipta
Copy link
Contributor

@dennypradipta dennypradipta commented Nov 29, 2024

Monika Pull Request (PR)

What feature/issue does this PR add

#1322

  1. Add fallback for getOSName so that it does not crash if fails to fetch the os name

How did you implement / how did you fix it

  1. Wrapped the function using try-catch
  2. Add fallback OS Name

How to test

  1. Run npm run start with notifications enabled. You should see the OS Name
  2. Build Docker (docker build . -t monika) and run it docker run -v ./monika.yml:/config/monika.yml --name monika monika monika --config /config/monika.yml. Be advised that notifications MUST be enabled. You should see the OS Name

Images

image
image

Additional Context

My machine is detected as macOS unknown, this is caused by old version of os-name. While I try to upgrade it, it didn't work because the newest version is ESM only, and you know how it goes with ESM modules for Monika... 😅

Copy link
Contributor

@sapiderman sapiderman left a comment

Choose a reason for hiding this comment

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

thank you

@sapiderman sapiderman merged commit dda317a into main Nov 29, 2024
9 checks passed
@sapiderman sapiderman deleted the story/1322 branch November 29, 2024 13:24
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.

Notification crashes, if linux distribution is not recognized by getos
3 participants