Skip to content

fix(rum): take os.version_major from the full OS name - #88

Open
Fiona2016 wants to merge 1 commit into
mainfrom
fix/os-version-major-full-name
Open

Fiona2016 wants to merge 1 commit into
mainfrom
fix/os-version-major-full-name

Conversation

@Fiona2016

Copy link
Copy Markdown
Collaborator

The OS version the SDK reports comes from deviceInfo.osFullName, which reads like OpenHarmony-6.1.1.125. RumEventAssembler.majorVersion took only the leading digits. For this form that gave an empty string, so every event went out without os.version_major.

majorVersion now takes the first run of digits: OpenHarmony-6.1.1.125 → 6. Versions that start with a number come out as before (5.0.0.102 → 5), and a version with no number still gives ''.

The active-device beacon doesn't send a major version, and its payload stays the same.

Tests

  • mapsHarmonyDeviceTypesToSchemaEnum adds the OpenHarmony-* and empty cases.
  • emitsSchemaVocabularyForOsDeviceConnectivityAndErrorId now assembles an event from an OpenHarmony-6.1.1.125 version and expects os.version_major = 6.
  • node scripts/unit-node/run.mjs: 622 passed, 0 failed. With the old majorVersion, the two new expectations fail.

The OS version comes from deviceInfo.osFullName, which reads like
"OpenHarmony-6.1.1.125". majorVersion took only the leading digits, so
it returned '' for that form and every event was sent without
os.version_major. Take the first run of digits instead; versions that
start with a number are unchanged.

This branch has not been deployed

No deployments
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.

1 participant