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(loggers): catch errors when parsing loggers metadata #3532

Merged
merged 1 commit into from
May 17, 2024

Conversation

emmenko
Copy link
Member

@emmenko emmenko commented May 17, 2024

No description provided.

@emmenko emmenko requested a review from a team as a code owner May 17, 2024 08:19
Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2024 8:19am

Copy link

changeset-bot bot commented May 17, 2024

🦋 Changeset detected

Latest commit: e351638

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@commercetools-backend/loggers Patch
@commercetools-applications/merchant-center-template-starter-typescript Patch
@commercetools-applications/merchant-center-template-starter Patch
@commercetools-applications/merchant-center-custom-view-template-starter-typescript Patch
@commercetools-applications/merchant-center-custom-view-template-starter Patch
@commercetools-backend/eslint-config-node Patch
@commercetools-backend/express Patch
@commercetools-frontend/actions-global Patch
@commercetools-frontend/application-components Patch
@commercetools-frontend/application-config Patch
@commercetools-frontend/application-shell-connectors Patch
@commercetools-frontend/application-shell Patch
@commercetools-frontend/assets Patch
@commercetools-frontend/babel-preset-mc-app Patch
@commercetools-frontend/browser-history Patch
@commercetools-frontend/codemod Patch
@commercetools-frontend/constants Patch
@commercetools-frontend/create-mc-app Patch
@commercetools-frontend/cypress Patch
@commercetools-frontend/eslint-config-mc-app Patch
@commercetools-frontend/i18n Patch
@commercetools-frontend/jest-preset-mc-app Patch
@commercetools-frontend/jest-stylelint-runner Patch
@commercetools-frontend/l10n Patch
@commercetools-frontend/mc-dev-authentication Patch
@commercetools-frontend/mc-html-template Patch
@commercetools-frontend/mc-scripts Patch
@commercetools-frontend/notifications Patch
@commercetools-frontend/permissions Patch
@commercetools-frontend/react-notifications Patch
@commercetools-frontend/sdk Patch
@commercetools-frontend/sentry Patch
@commercetools-frontend/url-utils Patch
@commercetools-local/playground Patch
@commercetools-local/visual-testing-app Patch
@commercetools-website/components-playground Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@emmenko emmenko requested a review from tdeekens May 17, 2024 08:19
Copy link
Contributor

@Rhotimee Rhotimee left a comment

Choose a reason for hiding this comment

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

Makes sense. Thanks

...(remoteAddress ? { remoteAddress } : {}),
};
try {
const remoteAddress = req.socket?.remoteAddress;
Copy link

Choose a reason for hiding this comment

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

Can we check the req.socket is not null first? I think the issue we got it because the socket isn't/wasn't success then there will be no remoteAddress as the result.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes the ?. does the null check

@emmenko emmenko merged commit 0f7a825 into main May 17, 2024
18 checks passed
@emmenko emmenko deleted the nm-fix-loggers-hostname-catch branch May 17, 2024 08:28
return {
clientIp: clientIp ?? remoteAddress,
proxyIps,
hostname: req.socket ? req.hostname : undefined,
Copy link
Member Author

Choose a reason for hiding this comment

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

We also added here an extra check for req.socket before accessing req.hostname

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.

None yet

5 participants