@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Log and continue when trying to destroy edges with no edge definition

Summary: Fixes T11201.

Test Plan:
Created bogus edges like this:

```
INSERT INTO edge (src, type, dst, dateCreated, seq) values ('PHID-TASK-vnddativbialb5p6ymis', 999999, 'quack', UNIX_TIMESTAMP(), 1);
```

Then ran `bin/remove destroy` on the relevant object.

Before the patch, destruction halted after hittin the bad edge.

After the patch, a warning is emitted but destruction continues.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11201

Differential Revision: https://secure.phabricator.com/D16171

+11 -1
+11 -1
src/infrastructure/edges/engineextension/PhabricatorEdgesDestructionEngineExtension.php
··· 28 28 foreach ($edges as $type => $type_edges) { 29 29 foreach ($type_edges as $src => $src_edges) { 30 30 foreach ($src_edges as $dst => $edge) { 31 - $editor->removeEdge($edge['src'], $edge['type'], $edge['dst']); 31 + try { 32 + $editor->removeEdge($edge['src'], $edge['type'], $edge['dst']); 33 + } catch (Exception $ex) { 34 + // We can run into an exception while removing the edge if the 35 + // edge type no longer exists. This prevents us from figuring out 36 + // if there's an inverse type. Just ignore any errors here and 37 + // continue, since the best we can do is clean up all the edges 38 + // we still have information about. See T11201. 39 + phlog($ex); 40 + } 32 41 } 33 42 } 34 43 } 44 + 35 45 $editor->save(); 36 46 } 37 47