-
Notifications
You must be signed in to change notification settings - Fork 799
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
Protect: Update fixer UI to handle long running fixers #39301
Merged
dkmyta
merged 97 commits into
trunk
from
update/protect-fixer-ui-to-handle-long-running-fixers
Sep 23, 2024
Merged
Protect: Update fixer UI to handle long running fixers #39301
dkmyta
merged 97 commits into
trunk
from
update/protect-fixer-ui-to-handle-long-running-fixers
Sep 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changelog changelog
changelog changelog
changelog changelog
Base automatically changed from
add/protect-fixer-status-to-initial-state
to
trunk
September 16, 2024 16:50
…-ui-to-handle-long-running-fixers
…-ui-to-handle-long-running-fixers
nateweller
previously approved these changes
Sep 17, 2024
nateweller
approved these changes
Sep 23, 2024
dkmyta
deleted the
update/protect-fixer-ui-to-handle-long-running-fixers
branch
September 23, 2024 18:00
gogdzl
pushed a commit
that referenced
this pull request
Oct 25, 2024
* Protect: React Query changelog changelog * Add fixerStatus to initial state * changelog * Fix in_progress fixer state * Fix tests * Fix fixThreats apiFetch call * Do not camelize fixerStatus in useFixersQuery initialData * Protect: React Query changelog changelog * Use fixableThreats prop from scan status * Protect: React Query changelog changelog * Protect: React Query * Fix merge errors * Ensure fixer status polling occurs when in_progress fixers exist * Protect: React Query * Invalidate scan status query on fixer status query success * Protect: React Query * Provide useFixersQuery threatIds default value * Protect: React Query * Reorder * Account for fixerStatus being false in useFixers hook * Protect: React Query * Temporarily disable optimistically setting fixer status * Protect: React Query * Simplify QUERY_FIXERS_KEY, and update setQueryData return formatting * Fixes and improvements * Protect: React Query * Update fixerInProgress logic * Conflict corrections * Fix fixInProgressThreatIds logic * Fix fixable_threat_ids type * Update property name * Fix useFixersQuery cachedData check logic * Protect: React Query * Protect: React Query * Protect: React Query * Handle fixer status optimistically * Add removed comment * Remove file * Fix types * Fix docblocks * Revert unintended changes * Protect: React Query * changelog * Handle long running fixers * Improve setting fixer status optimistically * Handle possible API returns * Handle statuses for nonexistent fixers * Filter fixable threats list for fix all threats modal * Fixes and improvements to existing code * Disable threat actions when fixer is stale * Changelog entry * Revert fixers mutation update * Improve use fixers query error handling * Update notice message * Readd removed comment * Fix naming * Update initial state default * Update initial state default * Ensure FixerStatus type matches response structure * Fix typo * Fix logic - fixer cannot be active and stale * Improvements * Improve useFixersQuery * Add comments * Apply dummy arg to avoid bad minification issues * Use clsx for conditional class names * Use memoized value for fixableList * Remove memoization of date * Remove memoization of initial query data from window * Centralize fixer logic and attempt to simplify the hook implementation * Fix syntax errors * Move stale fixer check to top of renderFixerStatus logic --------- Co-authored-by: Nate Weller <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Package] Protect Models
[Package] Protect Status
[Plugin] Protect
A plugin with features to protect a site: brute force protection, security scanning, and a WAF.
[Tests] Includes Tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Identifies when an
in_progress
fixer has been running for more than 24 hours and displays as stale.Dependant on 107053-ghe-Automattic/vaultpress
Proposed changes:
last_updated
property to determine if anin_progress
fixer is staleIconTooltip
to provide an explanation for this, prompt support requestin_progress
or considered stalefixableThreats
list for theFix all threat modal
when we determine thatin_progress
or stale fixers exist (to avoid subsequent fixer attempts, and ignore action being triggered)not_started
), to ensure that they are not included in the success and failure notice countsOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
status.fixable_threat_ids
)CredentialGate
component to disable itREST_Controller::api_fix_threats
to return the following (be sure to replace$threat_id
with the actual ID of the fixable threat, and $current_date accordingly) to disable actually fixing the threat:REST_Controller::api_fix_threats_status
to return the following (be sure to replace$threat_id
with the actual ID of the fixable threat) to simulate the return of a stalein_progress
:in_progress
or "stale" fixer status from either the main threats list threat card or theFix all threats
modal checklist