feral icon indicating copy to clipboard operation
feral copied to clipboard

Update ClientContext.client to allow it to be unset

Open bpholt opened this issue 2 months ago • 1 comments

Fixes #502.

When I was going through this writing the ContextPlatformSuites, I noticed that there are several other fields that are documented as nullable in the Java documentation. I'm not sure whether we want to fix all these by making them Options in the public API (which would probably mean a major version bump), find another way to deal with them, or just leave it alone until someone notices it in practice.

bpholt avatar Oct 15 '25 23:10 bpholt

I noticed that there are several other fields that are documented as nullable in the Java documentation. I'm not sure whether we want to fix all these by making them Options in the public API (which would probably mean a major version bump)

Yikes! I guess we should issue it and consider it for a major bump. I took a quick look at the JavaDocs but I don't see where nullability is indicated?

logGroupName and logStreamName are both nullable on runtime.Context, and then there are two fields that we're missing that are both null by default: tenantId and xrayTraceId.

The JS documentation doesn't mention potential nulls or undefineds, so I guess it's trial and error there. It makes me a little nervous to be making ClientContext.client an UndefOr but not doing the same for ClientContext.env, since they're described in the same block in the docs. It might be fine though.

bpholt avatar Oct 16 '25 16:10 bpholt