[release-4.23] OCPBUGS-112289: Flush async feature flag updates immediately - #17050
Conversation
Deferring all setFeatureFlag calls until the next render left flag-gated plugin routes and nav items missing for ~10s after an async console.flag/hookProvider resolved. Keep render-time updates deferred, but dispatch async updates right away. Fixes openshift#16922 Co-authored-by: Cursor <cursoragent@cursor.com>
Update flagsRef when dispatching so consecutive async setFeatureFlag calls (e.g. true then false before Redux re-renders) are not skipped against a stale selector snapshot. Strengthen unit coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Always dispatch pending setFeatureFlag updates instead of syncing a local FLAGS snapshot. Flags are also set elsewhere and read via useFlag, so a locally mutated copy can go stale. Immutable Map.set is already a no-op when the value is unchanged.
Replace render-phase isRenderingRef tracking with a coalesced queueMicrotask flush so child FeatureFlagExtensionHookResolver re-renders cannot dispatch during render. Drop the stale flagsRef comment and exercise the controller through renderHookWithProviders against a real Redux store.
Unlock after taking the batch so reentrant setFeatureFlag during dispatch can schedule a follow-up microtask. Use createTestPluginStore in tests and cover the reentrant-update path.
createTestPluginStore passed into renderHookWithProviders is enough; sibling console-app tests rely on the same pattern without mocking plugins.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: openshift-cherrypick-robot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@openshift-cherrypick-robot: Jira Issue OCPBUGS-111707 has been cloned as Jira Issue OCPBUGS-112289. Will retitle bug to link to clone. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-112289, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/close |
|
@logonoff: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-112289. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This is an automated cherry-pick of #16949
/assign logonoff