Closed Bug 1910809 Opened 1 year ago Closed 1 year ago

Object metric: document (and possibly improve) behavior of null values

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: afranchuk, Assigned: janerik)

Details

Attachments

(2 files)

Since null values aren't valid (as far as I know, though maybe they can be set as arrays or objects?), it'd be great if Glean allowed setString JSON objects to contain nulls and automatically ignore/remove them where appropriate (e.g. for an object where a key maps to null, the key will be removed). Right now, nulls seem to result in the metric not being set.

Whether the behavior changes or not, it'd be helpful to document it explicitly.

I actually think this is already the case for the Rust API; and for the JavaScript API too.
Are you running into trouble from Kotlin?

I'll take a look, at a test and better docs.

Assignee: nobody → jrediger
Priority: -- → P2

I'm having trouble in Rust.

Oh. Ok, I take a look.

Can you show what code is going wrong? Because I currently cannot reproduce that.

Flags: needinfo?(afranchuk)

https://phabricator.services.mozilla.com/D218215

If you comment out the call to remove_nulls in this patch, a test will fail with the metric being unset (run mach rusttests).

Flags: needinfo?(afranchuk)

I can reproduce that now, I'll look into it.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: