Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] LocalizationConfiguration implementation overwrite ActiveLocale value on initialization. #28357

Closed
yonko-gospodinov opened this issue Jul 28, 2023 · 1 comment · Fixed by #29024
Labels
bug Something isn't working darwin needs triage

Comments

@yonko-gospodinov
Copy link

Reproduction steps

I'm developing a Matter bridge and there for the LocalizationConfiguration::ActiveLocale attribute is set as external. Current active locale of the system is en-US and supported locales are: it-IT, de-DE, en-US, es-ES, fr-FR and en-GB.

  1. Start the Matter bridge.
  2. Matter stack is always changing system locale to it-IT. Expectation is system locale to stay unchanged.

Bug prevalence

On every system start.

GitHub hash of the SDK that was being used

8f66f42 (tag: v1.1.0.1)

Platform

darwin

Platform Version(s)

No response

Anything else?

During initialization, the emberAfLocalizationConfigurationClusterServerInitCallback function in localization-configuration-server.cpp is called. This function gets the active locale value and check if it is part of the supported locales. If it is not, set the first supported locale as active locale. This logic is triggered every time, because ActiveLocale::Get fail to set the correct size of the locale and outLocale.data_equal(activeLocale) always return false.

The definition of ActiveLocale::Get is:
EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string
there for calling:
value.reduce_size(length);
do not have the expected effect.

Change the definition of ActiveLocale::Get to:
EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string
is fixing the problem.

@yonko-gospodinov yonko-gospodinov added bug Something isn't working needs triage labels Jul 28, 2023
@yonko-gospodinov yonko-gospodinov changed the title [BUG] LocalizationConfiguration implementation ovetwrite ActiveLocale value on initialization. [BUG] LocalizationConfiguration implementation overwrite ActiveLocale value on initialization. Jul 28, 2023
bzbarsky-apple added a commit to bzbarsky-apple/zap that referenced this issue Sep 1, 2023
See project-chip/connectedhomeip#28357: we are not
mutating the actual value the caller will observe.
@bzbarsky-apple
Copy link
Contributor

The definition of ActiveLocale::Get is:

@yonko-gospodinov thank you for finding that, an I am sorry this took so long to get to: it got the "darwin" label auto-added, and I had not been triaging those issues, so just noticed this...

This needs to be fixed on the ZAP side. Created project-chip/zap#1122 to fix that there, then we'll need to update ZAP version.

brdandu pushed a commit to project-chip/zap that referenced this issue Sep 1, 2023
* Fix accessor signatures for string/octstr attributes.

See project-chip/connectedhomeip#28357: we are not
mutating the actual value the caller will observe.

* Address review comment.
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Sep 1, 2023
The old signature did not propagate the update length of the span to the caller.

Fixes project-chip#28357
@mergify mergify bot closed this as completed in #29024 Sep 1, 2023
mergify bot pushed a commit that referenced this issue Sep 1, 2023
The old signature did not propagate the update length of the span to the caller.

Fixes #28357
@github-project-automation github-project-automation bot moved this from Todo to Done in [Platform] Darwin Sep 1, 2023
abpoth pushed a commit to abpoth/connectedhomeip that referenced this issue Sep 12, 2023
…ct-chip#29024)

The old signature did not propagate the update length of the span to the caller.

Fixes project-chip#28357
HunsupJung pushed a commit to HunsupJung/connectedhomeip that referenced this issue Oct 23, 2023
…ct-chip#29024)

The old signature did not propagate the update length of the span to the caller.

Fixes project-chip#28357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working darwin needs triage
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants