Skip to content

RUM-11121: Make accessibility send only mutations#2806

Merged
jonathanmos merged 5 commits into
developfrom
jmoskovich/rum-11121/accessibility-view-updates
Aug 7, 2025
Merged

RUM-11121: Make accessibility send only mutations#2806
jonathanmos merged 5 commits into
developfrom
jmoskovich/rum-11121/accessibility-view-updates

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Jul 29, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Previous state:
Accessibility attributes were collected and sent only when the flag collectAccessibilitySettings was set, this flag being an internal flag in RumInternalProxy. Attributes were sent as custom tags in view update events.

New state:
Accessibility attributes will be sent for all users who set the feature flag collectAccessibility (which is now public in RumConfiguration and has been renamed to match the ios api). The attributes will be sent as part of the view schema and not as custom tags. Additionally these attributes are send-only-once, meaning that accessibility attributes are only sent the first time they have a non-null value, and subsequently only if they change.

Api for accessibility:

.collectAccessibility(enabled = true/false)

Motivation

Part of the effort to expand metadata visibility.

Additional Notes

Contains an update to the RUM schema to support sending the RTL Enabled attribute - this attribute indicates whether right-to-left layout was set on the user's device.

Contains a change to how view filtering works. Previously we sent only the view update with the max doc version, however this causes issues with the send-only-once mechanism. Therefore we now send if either the previous condition was true OR the update contains accessibility changes.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter

codecov-commenter commented Jul 29, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.16981% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.02%. Comparing base (7a3b081) to head (edfd0ad).
⚠️ Report is 1871 commits behind head on develop.

Files with missing lines Patch % Lines
...rum/internal/domain/accessibility/Accessibility.kt 91.67% 0 Missing and 1 partial ⚠️
...domain/accessibility/DatadogAccessibilityReader.kt 85.71% 0 Missing and 1 partial ⚠️
...cessibility/DefaultAccessibilitySnapshotManager.kt 91.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2806      +/-   ##
===========================================
+ Coverage    69.93%   70.02%   +0.09%     
===========================================
  Files          834      834              
  Lines        31225    31296      +71     
  Branches      5243     5259      +16     
===========================================
+ Hits         21837    21914      +77     
+ Misses        7908     7907       -1     
+ Partials      1480     1475       -5     
Files with missing lines Coverage Δ
...rum/src/main/kotlin/com/datadog/android/rum/Rum.kt 88.52% <100.00%> (ø)
...kotlin/com/datadog/android/rum/RumConfiguration.kt 97.44% <100.00%> (ø)
...otlin/com/datadog/android/rum/_RumInternalProxy.kt 73.68% <ø> (+3.68%) ⬆️
...lin/com/datadog/android/rum/internal/RumFeature.kt 92.62% <100.00%> (+1.23%) ⬆️
...tadog/android/rum/internal/domain/RumDataWriter.kt 100.00% <100.00%> (ø)
.../android/rum/internal/domain/event/RumEventMeta.kt 73.68% <100.00%> (+4.93%) ⬆️
...id/rum/internal/domain/event/RumViewEventFilter.kt 100.00% <100.00%> (ø)
...d/rum/internal/domain/scope/RumApplicationScope.kt 95.41% <100.00%> (+0.92%) ⬆️
...droid/rum/internal/domain/scope/RumSessionScope.kt 96.03% <100.00%> (ø)
...d/rum/internal/domain/scope/RumViewManagerScope.kt 91.43% <100.00%> (-0.48%) ⬇️
... and 5 more

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-11121/accessibility-view-updates branch from 63e97a5 to 97fa265 Compare July 30, 2025 07:42
@jonathanmos jonathanmos changed the title Roll out accessibility and send attributes once RUM-11121: Make accessibility send only mutations Jul 31, 2025
@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-11121/accessibility-view-updates branch 2 times, most recently from b4fe983 to 4c0300a Compare August 6, 2025 09:18
@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-11121/accessibility-view-updates branch from 4c0300a to d674678 Compare August 6, 2025 09:53
@jonathanmos
jonathanmos marked this pull request as ready for review August 6, 2025 10:51
@jonathanmos
jonathanmos requested review from a team as code owners August 6, 2025 10:51
ambushwork
ambushwork previously approved these changes Aug 6, 2025
@jonathanmos
jonathanmos merged commit c6b7a43 into develop Aug 7, 2025
25 of 26 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/rum-11121/accessibility-view-updates branch August 7, 2025 10:28
}

/**
* Whether to collect accessibility attributes inside the RUM view update event.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customers unlikely know that RUM View update event is. Maybe we can simply remove inside the RUM view update event part?

// for a give viewId in the batch, because backend will do the same during the reduce process
@Suppress("UnsafeThirdPartyFunctionCall") // if there is a meta, there is a max doc version
viewMeta.documentVersion == maxDocVersionByViewId.getValue(viewMeta.viewId)
viewMeta.hasAccessibility == true ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if we have accessibility enabled, we simply don't have any view reducing on the client side? do I get it right?

Or not every view update has hasAccessibility even if accessibility collection is enabled?

Comment on lines +16 to +22
textSize = forge.aNullable { forge.aString() },
rtlEnabled = forge.aNullable { forge.aBool() },
screenReaderEnabled = forge.aNullable { forge.aBool() },
increaseContrastEnabled = forge.aNullable { forge.aBool() },
reducedAnimationsEnabled = forge.aNullable { forge.aBool() },
invertColorsEnabled = forge.aNullable { forge.aBool() },
singleAppModeEnabled = forge.aNullable { forge.aBool() }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, aNullable already has Forge as a receiver in the lambda, so it can be forge.aNullable { aString }, etc.

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.

5 participants