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

fix: localization - avoid NoSuchElementException when adding a new locale #1652

Merged
merged 1 commit into from
May 10, 2024

Conversation

andreassteinmann
Copy link
Collaborator

@andreassteinmann andreassteinmann commented May 7, 2024

PR Type

[x] Bugfix

What Is the Current Behavior?

The fix addresses the issue #1646 when adding a new locale.

What Is the New Behavior?

first() expects the source Observable to emit at least one item. If the Observable completes without any emissions, first() will throw a NoSuchElementException to indicate that no elements were emitted. In the context of the issue, if the Observable is expected to emit at least one value but doesn't, first() enforces the emission of at least one item. This could happen if, for example, the translation data isn't loaded as expected due to a network issue, incorrect configuration, or if the data is filtered out before it reaches first(). It is now changed to take(1).

Does this PR Introduce a Breaking Change?

[x] No

Other Information

AB#96420

@andreassteinmann andreassteinmann self-assigned this May 7, 2024
@andreassteinmann andreassteinmann requested a review from SGrueber May 7, 2024 14:42
@andreassteinmann andreassteinmann changed the title fix: Localization - avoid NoSuchElementException when adding a new locale fix: localization - avoid NoSuchElementException when adding a new locale May 8, 2024
@shauke shauke added this to the 5.2 milestone May 10, 2024
@shauke shauke added the bug Something isn't working label May 10, 2024
@shauke shauke merged commit b4971a3 into develop May 10, 2024
26 checks passed
@shauke shauke deleted the fix/localization-no-such-element-exception branch May 10, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants