MCPcopy Create free account
hub / github.com/facebook/Rapid / _updateResolvedIssues

Method _updateResolvedIssues

modules/core/ValidationSystem.js:685–701  ·  view source on GitHub ↗

* _updateResolvedIssues * Determine if any issues were resolved for the given entities. * This is called by `validateAsync()` after validation of the head graph * * Give the user credit for fixing an issue if: * - the issue is in the base cache * - the issue is not in the head cach

(entityIDs = [])

Source from the content-addressed store, hash-verified

683 * @param {Array|Set} entityIDs - Array or Set containing entity IDs.
684 */
685 _updateResolvedIssues(entityIDs = []) {
686 for (const entityID of entityIDs) {
687 const issues = this._base.entityIssueIDs.get(entityID) ?? [];
688 for (const issueID of issues) {
689 // Check if the user did something to one of the entities involved in this issue.
690 // (This issue could involve multiple entities, e.g. disconnected routable features)
691 const issue = this._base.issues.get(issueID);
692 const userModified = (issue?.entityIds || []).some(entityID => this._completeDiff.has(entityID));
693
694 if (userModified && !this._head.issues.has(issueID)) { // issue seems fixed
695 this._resolvedIssueIDs.add(issueID);
696 } else { // issue still not resolved
697 this._resolvedIssueIDs.delete(issueID); // (did undo, or possibly fixed and then re-caused the issue)
698 }
699 }
700 }
701 }
702
703
704 /**

Callers 2

validateAsyncMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected