Skip to content

[PM-36838] Render DeviceType display name in event integration templates#8011

Open
lastbestdev wants to merge 3 commits into
mainfrom
events-device-type-display-name
Open

[PM-36838] Render DeviceType display name in event integration templates#8011
lastbestdev wants to merge 3 commits into
mainfrom
events-device-type-display-name

Conversation

@lastbestdev

@lastbestdev lastbestdev commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-36838

Relates to bitwarden/clients#21600

📔 Objective

The #DeviceType# integration template token resolved to the DeviceType enum member identifier (e.g. "ChromeExtension") because ReplaceTokens calls .ToString() on the value. Expose the [Display(Name)] value via GetDisplayName() so rendered event payloads show the friendly name (e.g. "Chrome Extension") instead.

📸 Screenshots

Event sent to Splunk (see "deviceName" value. "Chrome" is the display value for the "ChromeBrowser" device type enum member)

image

The #DeviceType# integration template token resolved to the DeviceType
enum member identifier (e.g. "ChromeExtension") because ReplaceTokens
calls .ToString() on the value. Expose the [Display(Name)] value via
GetDisplayName() so rendered event payloads show the friendly name
(e.g. "Chrome Extension") instead.
@lastbestdev
lastbestdev requested a review from a team as a code owner July 17, 2026 23:31
@lastbestdev
lastbestdev requested a review from Banrion July 17, 2026 23:31
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed a focused bugfix that changes IntegrationTemplateContext.DeviceType from the raw DeviceType? enum to Event.DeviceType?.GetDisplayName(), so event integration templates render the friendly [Display(Name)] value (e.g. "Chrome Extension") instead of the enum identifier ("ChromeExtension"). Traced the token-replacement path in IntegrationTemplateProcessor.ReplaceTokens, confirmed the property is only consumed via reflection-based token substitution, and verified GetDisplayName safely falls back to the enum name when no [Display] attribute exists. Null handling and DeviceTypeId behavior are preserved and covered by new unit tests.

No security, correctness, breaking-change, or performance concerns were found.

Code Review Details

No findings. The change is small, well-scoped, and appropriately tested for both the set and null device-type cases.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.46%. Comparing base (3a88797) to head (9d86481).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8011   +/-   ##
=======================================
  Coverage   62.45%   62.46%           
=======================================
  Files        2293     2293           
  Lines       99797    99797           
  Branches     9007     9008    +1     
=======================================
+ Hits        62330    62336    +6     
+ Misses      35295    35288    -7     
- Partials     2172     2173    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lastbestdev lastbestdev added t:tech-debt Change Type - Tech debt needs-qa labels Jul 20, 2026
@bre-deploy
bre-deploy Bot deployed to EU-QA Cloud July 22, 2026 00:07 Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants