Skip to content

Log unexpected null creator field#388

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
utahkanz-ops:fix/333-log-null-creator-fields
May 31, 2026
Merged

Log unexpected null creator field#388
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
utahkanz-ops:fix/333-log-null-creator-fields

Conversation

@utahkanz-ops
Copy link
Copy Markdown
Contributor

Summary

  • Added a warn-level structured log in the creator list result mapper when displayName, a non-nullable CreatorProfile schema field, is unexpectedly returned as null from the database. The mapper still returns the same public response shape as before, so the null case continues to serialize as name: null for clients while giving maintainers visibility into the data integrity problem.

Issue

Changes

  • Added null detection for the schema-required displayName field during creator list item mapping.
  • Included fieldName, creatorId, and requestId in the warning payload.
  • Read the request ID from the existing async request context so the log can be correlated with the request that produced the mapped result.
  • Converted the mapper coverage to Jest assertions and added a regression test proving the null response behavior remains unchanged while the warning is emitted.

Validation

  • pnpm.cmd exec jest src/modules/creators/creator-list-item.mapper.test.ts --runInBand passed.
  • pnpm.cmd lint passed.
  • pnpm.cmd build was run but did not complete successfully because Prisma Client was not generated in this Windows environment after pnpm blocked dependency build scripts. pnpm.cmd exec prisma generate and pnpm.cmd exec prisma --version both timed out before producing output, so the build failure appears environment/tooling-related rather than caused by this mapper change.

Notes

  • The public client response for the unexpected null case is intentionally unchanged.
  • pnpm-lock.yaml was not modified.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@utahkanz-ops Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit 5f0c674 into accesslayerorg:main May 31, 2026
1 check passed
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.

Add structured log for unexpected null creator fields in database results

2 participants