Skip to content

Log identity meta unmarshalling errors instead of returning them #4187

@coderabbitai

Description

@coderabbitai

Problem

Currently, when unmarshalling identity meta fails in various API handlers, the error is returned and blocks the entire request. This behavior should be changed to just log the error and continue processing the request.

Context

This was identified during the review of PR #4145, specifically in the discussion at #4145 (comment)

Multiple handlers exhibit this pattern where db.UnmarshalNullableJSONTo errors for identity meta are returned rather than logged:

  • go/apps/api/routes/v2_keys_verify_key/handler.go
  • go/apps/api/routes/v2_keys_whoami/handler.go
  • go/apps/api/routes/v2_apis_list_keys/handler.go
  • go/apps/api/routes/v2_keys_get_key/handler.go

Expected Behavior

When identity meta unmarshalling fails, the error should be logged and the request should continue without blocking. The meta field can be left nil/unset in the response.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions