Skip to content

Conversation

@dmrdvn
Copy link
Contributor

@dmrdvn dmrdvn commented Dec 22, 2025

🐛 Bug Fix

Problem

Credential components crashed when public_notes field contained:

  • null or undefined values
  • Malformed JSON strings

Affected components:

  • Credential card list
  • Credential details modal
  • Delete credential dialog

Solution

  • Added safeParse utility function in shared/index.ts
  • Replaced all unsafe JSON.parse() calls
  • Added JSDoc documentation
  • Generic type support for type safety

Changes

  • shared/index.ts - New safeParse utility
  • credential-card.tsx - Import safeParse
  • credential-details.tsx - Import safeParse with types
  • delete-credential.tsx - Import safeParse with types

Testing

  • TypeScript compilation passes
  • No runtime crashes on invalid JSON
  • Backward compatible (empty object fallback)

Add safeParse utility to safely parse credential.public_notes.
Prevents component crashes from malformed JSON data.
@vercel
Copy link

vercel bot commented Dec 22, 2025

@dmrdvn is attempting to deploy a commit to the idOS Engineering Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 6, 2026

Open in StackBlitz

@idos-network/client

npm i https://pkg.pr.new/idos-network/idos-sdk-js/@idos-network/client@1275

@idos-network/consumer

npm i https://pkg.pr.new/idos-network/idos-sdk-js/@idos-network/consumer@1275

@idos-network/credentials

npm i https://pkg.pr.new/idos-network/idos-sdk-js/@idos-network/credentials@1275

@idos-network/issuer

npm i https://pkg.pr.new/idos-network/idos-sdk-js/@idos-network/issuer@1275

@idos-network/utils

npm i https://pkg.pr.new/idos-network/idos-sdk-js/@idos-network/utils@1275

commit: 13fbf49

@vercel
Copy link

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
data-dashboard Ready Ready Preview, Comment Jan 6, 2026 2:51pm

Copy link
Collaborator

@ditoglez ditoglez left a comment

Choose a reason for hiding this comment

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

Thanks @dmrdvn for your contribution!

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.

2 participants