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 clearing cache of failed locale lookup after successfully resolving locale #783

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

JamesMcIntosh
Copy link
Contributor

@JamesMcIntosh JamesMcIntosh commented Jan 29, 2024

Inside of the composite message lookup there is a clause which will never be executed that clears the cache after successfully resolving the locale.

The clause is meant to handle the case where a message is looked up before the messages have been successfully loaded as it leave the cache in a state where _lastLocale has been set and _lastLookup is null.

Since this clause is broken then any subsequent attempt to access a message from that locale will fail as the _lookupMessageCatalog is never called again to load the messages.


  • [/] I’ve reviewed the contributor guide and applied the relevant portions to this PR.

Copy link

PR Health

Breaking changes ✔️

Details
Package Change Current Version New Version Needed Version Looking good?
intl None 0.20.0-wip 0.20.0-wip 0.20.0-wip ✔️

Changelog Entry ✔️

Details
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ⚠️

Details
File Coverage
pkgs/intl/lib/message_lookup_by_library.dart 💔 Not covered

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check

License Headers ✔️

Details
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/intl_translation/example/lib/generated/messages_all.dart
pkgs/intl_translation/example/lib/generated/messages_all_locales.dart
pkgs/intl_translation/example/lib/generated/messages_de.dart
pkgs/intl_translation/example/lib/generated/messages_de_CH.dart
pkgs/intl_translation/example/lib/generated/messages_en.dart
pkgs/intl_translation/example/lib/generated/messages_es.dart
pkgs/intl_translation/example/lib/generated/messages_iw.dart
pkgs/intl_translation/test/generate_localized/code_map_messages_all.dart
pkgs/intl_translation/test/generate_localized/code_map_messages_all_locales.dart
pkgs/intl_translation/test/generate_localized/code_map_messages_fr.dart
pkgs/intl_translation/test/two_components/app_messages_all.dart
pkgs/intl_translation/test/two_components/app_messages_all_locales.dart
pkgs/intl_translation/test/two_components/app_messages_fr.dart
pkgs/intl_translation/test/two_components/component_messages_all.dart
pkgs/intl_translation/test/two_components/component_messages_all_locales.dart
pkgs/intl_translation/test/two_components/component_messages_fr_xyz123.dart
pkgs/messages/example_json/lib/testarb.g.dart
pkgs/messages/example_json/lib/testarbctx2.g.dart
pkgs/messages_shrinker/bin/messages_shrinker.dart

Package publish validation ✔️

Details
Package Version Status
package:intl 0.20.0-wip WIP (no publish necessary)
package:intl4x 0.7.1 already published at pub.dev
package:intl_translation 0.20.0-wip WIP (no publish necessary)
package:messages 0.2.0 already published at pub.dev
package:messages_builder 0.2.1 already published at pub.dev
package:messages_serializer 0.2.1 already published at pub.dev
package:messages_shrinker 0.2.1 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@mosuem mosuem self-requested a review January 30, 2024 15:32
Copy link
Member

@mosuem mosuem left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

pkgs/intl/CHANGELOG.md Show resolved Hide resolved
@copybara-service copybara-service bot merged commit fadcbfd into dart-lang:main Feb 1, 2024
14 checks passed
@JamesMcIntosh
Copy link
Contributor Author

Hi @mosuem, just wondering where things are at with getting a release out with this included?
Many thanks!
James

@mosuem
Copy link
Member

mosuem commented May 28, 2024

I believe this is released with v.0.20.0

@JamesMcIntosh
Copy link
Contributor Author

Thanks for replying @mosuem
0.20 isn't released yet, was wondering if you knew when it will be released as things went quiet after the WASM changes.

@mosuem
Copy link
Member

mosuem commented May 28, 2024

Ah sorry, I was looking at package:intl_translation! I think there is no big hurdle for package:intl, except that it is pinned by Flutter which makes rolling difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants