Skip to content

Conversation

@mattkae
Copy link
Contributor

@mattkae mattkae commented Dec 18, 2025

fixes #179563

What's new?

  • The viewId on the announce semantics event may be either an int32 or an int64, depending on what the codec perceives is best
  • We should parse either one of them on the Win32 side of things

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-windows Building on or for Windows specifically a: desktop Running on desktop labels Dec 18, 2025
@mattkae mattkae requested a review from loic-sharma December 18, 2025 15:44
@mattkae mattkae marked this pull request as ready for review December 18, 2025 15:44
Comment on lines 72 to 80
FlutterViewId view_id;
const auto* view_id_64 = std::get_if<FlutterViewId>(&view_itr->second);
const auto* view_id_32 = std::get_if<int32_t>(&view_itr->second);

if (view_id_64) {
view_id = *view_id_64;
} else if (view_id_32) {
view_id = static_cast<FlutterViewId>(*view_id_32);
} else {
Copy link
Member

Choose a reason for hiding this comment

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

I see EncodableValue::LongValue exists, but it throws:

// Convenience method to simplify handling objects received from Flutter
// where the values may be larger than 32-bit, since they have the same type
// on the Dart side, but will be either 32-bit or 64-bit here depending on
// the value.
//
// Calling this method if the value doesn't contain either an int32_t or an
// int64_t will throw an exception.
int64_t LongValue() const {
if (std::holds_alternative<int32_t>(*this)) {
return std::get<int32_t>(*this);
}
return std::get<int64_t>(*this);
}

What do you think of adding a std::optional<int64_t> EncodableValue::TryGetLongValue() method?

This would let us simplify this logic, something like:

const auto view_id_val = view_itr->second.TryGetLongValue();
if (!view_id_val) {
  FML_LOG(ERROR)
    << "Announce message 'viewId' property must be a FlutterViewId.";
  return;
}

const auto view_id = static_cast<FlutterViewId>(*view_id_val);
plugin->Announce(view_id, *message);

Copy link
Contributor Author

@mattkae mattkae Dec 19, 2025

Choose a reason for hiding this comment

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

Agreed!

@loic-sharma
Copy link
Member

This regression indicates we should have a test. What do you think of adding a accessibility_plugin_unittests.cc file that sends a message and verifies the mocks are called as expected? This might be useful prior art: https://github.com/flutter/flutter/blob/master/engine/src/flutter/shell/platform/windows/cursor_handler_unittests.cc

…her an int32_t or an int64_t depending on its value
@mattkae
Copy link
Contributor Author

mattkae commented Dec 19, 2025

This regression indicates we should have a test. What do you think of adding a accessibility_plugin_unittests.cc file that sends a message and verifies the mocks are called as expected? This might be useful prior art: https://github.com/flutter/flutter/blob/master/engine/src/flutter/shell/platform/windows/cursor_handler_unittests.cc

Agree!

@mattkae mattkae requested a review from loic-sharma December 19, 2025 14:59
messenger()->SimulateEngineMessage(
kAccessibilityChannelName, encoded->data(), encoded->size(),
[](const uint8_t* reply, size_t reply_size) {});
}
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for going above and beyond with these tests! :)

Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

Looks great, excellent work!

@mattkae mattkae added this pull request to the merge queue Dec 19, 2025
Merged via the queue into flutter:master with commit a214a35 Dec 19, 2025
178 of 179 checks passed
@mattkae mattkae deleted the bugfix/179563 branch December 19, 2025 20:20
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 20, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 20, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 21, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 21, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 21, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 22, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 22, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 22, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 23, 2025
…d as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 23, 2025
Manual roll Flutter from 57c3f8b to 6ff7f30 (83 revisions)

Manual roll requested by stuartmorgan@google.com

flutter/flutter@57c3f8b...6ff7f30

2025-12-23 engine-flutter-autoroll@skia.org Roll Packages from f28cf2e to 5e3a766 (3 revisions) (flutter/flutter#180232)
2025-12-23 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from CmFPyvSc-K8_WDd5p... to 5EgkVbjGVZmCFPdtR... (flutter/flutter#180230)
2025-12-23 engine-flutter-autoroll@skia.org Roll Skia from db7ec9a14905 to bdb147ae3040 (2 revisions) (flutter/flutter#180222)
2025-12-23 bruno.leroux@gmail.com Add SnackBarTheme (flutter/flutter#180001)
2025-12-23 engine-flutter-autoroll@skia.org Roll Skia from 0b1ba3920f1c to db7ec9a14905 (1 revision) (flutter/flutter#180219)
2025-12-23 engine-flutter-autoroll@skia.org Roll Dart SDK from 31e9f619e18a to 94b05f717ba3 (1 revision) (flutter/flutter#180216)
2025-12-23 engine-flutter-autoroll@skia.org Roll Skia from a3e4f7b9d5f3 to 0b1ba3920f1c (1 revision) (flutter/flutter#180214)
2025-12-23 engine-flutter-autoroll@skia.org Roll Skia from b8517d1e25f7 to a3e4f7b9d5f3 (2 revisions) (flutter/flutter#180211)
2025-12-23 dkwingsmt@users.noreply.github.com [Engine] iOS style blurring (flutter/flutter#175458)
2025-12-23 engine-flutter-autoroll@skia.org Roll Dart SDK from 2243e91acaf2 to 31e9f619e18a (1 revision) (flutter/flutter#180210)
2025-12-22 36861262+QuncCccccc@users.noreply.github.com Add error description for nbsp character(\u202f) (flutter/flutter#178895)
2025-12-22 engine-flutter-autoroll@skia.org Roll Skia from 98c01ea504d7 to b8517d1e25f7 (1 revision) (flutter/flutter#180207)
2025-12-22 116356835+AbdeMohlbi@users.noreply.github.com Small clean up in `LocalizationPlugin` (flutter/flutter#180053)
2025-12-22 engine-flutter-autoroll@skia.org Roll Skia from c5beca8fa90b to 98c01ea504d7 (2 revisions) (flutter/flutter#180202)
2025-12-22 engine-flutter-autoroll@skia.org Roll Dart SDK from cff33b09b24d to 2243e91acaf2 (1 revision) (flutter/flutter#180199)
2025-12-22 116356835+AbdeMohlbi@users.noreply.github.com Remove usages of Android's `AsyncTask` in favor of `java.util.concurrent` (flutter/flutter#180050)
2025-12-22 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 18ZvfJB61p7Z8HAaC... to CmFPyvSc-K8_WDd5p... (flutter/flutter#180193)
2025-12-22 engine-flutter-autoroll@skia.org Roll Skia from 7b7083ed9d57 to c5beca8fa90b (5 revisions) (flutter/flutter#180187)
2025-12-22 engine-flutter-autoroll@skia.org Roll Dart SDK from 38812d17127d to cff33b09b24d (1 revision) (flutter/flutter#180185)
2025-12-22 engine-flutter-autoroll@skia.org Roll Skia from 0eef18a0e2e6 to 7b7083ed9d57 (1 revision) (flutter/flutter#180184)
2025-12-22 engine-flutter-autoroll@skia.org Roll Dart SDK from 66c8013acbff to 38812d17127d (1 revision) (flutter/flutter#180179)
2025-12-21 engine-flutter-autoroll@skia.org Roll Skia from 6fbc6c75b9bb to 0eef18a0e2e6 (2 revisions) (flutter/flutter#180176)
2025-12-21 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from kGnnY1-fTWwYAnk8e... to 18ZvfJB61p7Z8HAaC... (flutter/flutter#180173)
2025-12-21 engine-flutter-autoroll@skia.org Roll Skia from 1a4ca755288a to 6fbc6c75b9bb (1 revision) (flutter/flutter#180167)
2025-12-20 engine-flutter-autoroll@skia.org Roll Skia from 2ad7452bd9d1 to 1a4ca755288a (1 revision) (flutter/flutter#180160)
2025-12-20 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from oe10epXkqGnv21AbZ... to kGnnY1-fTWwYAnk8e... (flutter/flutter#180158)
2025-12-20 engine-flutter-autoroll@skia.org Roll Skia from b01ad49ea807 to 2ad7452bd9d1 (1 revision) (flutter/flutter#180155)
2025-12-20 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fb1c0c0a8ae to 66c8013acbff (1 revision) (flutter/flutter#180154)
2025-12-20 737941+loic-sharma@users.noreply.github.com Remove unnecessary RadioGroup migration TODOs (flutter/flutter#180105)
2025-12-20 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[reland] Unify canvas creation and Surface code in Skwasm and CanvasKit (#179473)" (flutter/flutter#180152)
2025-12-20 engine-flutter-autoroll@skia.org Roll Skia from 3cc7e81928f0 to b01ad49ea807 (1 revision) (flutter/flutter#180151)
2025-12-20 engine-flutter-autoroll@skia.org Roll Dart SDK from ac95c6e8a31d to 8fb1c0c0a8ae (1 revision) (flutter/flutter#180148)
2025-12-19 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#180146)
2025-12-19 engine-flutter-autoroll@skia.org Roll Skia from fa4434632ce6 to 3cc7e81928f0 (4 revisions) (flutter/flutter#180142)
2025-12-19 1961493+harryterkelsen@users.noreply.github.com [reland] Unify canvas creation and Surface code in Skwasm and CanvasKit (flutter/flutter#179473)
2025-12-19 engine-flutter-autoroll@skia.org Roll Skia from ae5dd72b3591 to fa4434632ce6 (2 revisions) (flutter/flutter#180136)
2025-12-19 45459898+RamonFarizel@users.noreply.github.com Semantics headingLeveldoc update (flutter/flutter#179999)
2025-12-19 matt.kosarek@canonical.com Fix an issue where the semantics announce event may be encoded as either an int32_t or an int64_t depending on its value (flutter/flutter#180071)
2025-12-19 bkonyi@google.com [ Web ] Pass `--enable-experimental-ffi` when compiling WASM tests (flutter/flutter#180127)
2025-12-19 engine-flutter-autoroll@skia.org Roll Dart SDK from cfc117d10d36 to ac95c6e8a31d (1 revision) (flutter/flutter#180130)
2025-12-19 58529443+srujzs@users.noreply.github.com Pass canaryFeatures to BuildSettings (flutter/flutter#180108)
2025-12-19 engine-flutter-autoroll@skia.org Roll Skia from fe2be289c9fe to ae5dd72b3591 (1 revision) (flutter/flutter#180129)
2025-12-19 engine-flutter-autoroll@skia.org Roll Packages from 6f392aa to f28cf2e (1 revision) (flutter/flutter#180124)
2025-12-19 94012149+richardexfo@users.noreply.github.com Set text input purpose and hints on Linux platform (flutter/flutter#180013)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: desktop Running on desktop engine flutter/engine related. See also e: labels. platform-windows Building on or for Windows specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExpansionTile throws: Announce message 'viewId' property must be a FlutterViewId

2 participants