@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.

Fix a JS console warning when hovering over replies to ghosts on lines which no longer exist

Summary:
Fixes T11662. In the very obscure situation described in that task, quiet a JS console warning.

The actual edit operation appears to work correctly after changes elsewhere.

There aren't really any legitimate lines for us to highlight in this case so I'm just giving up rather than trying to do something approximate.

Test Plan:
- Wrote `long.txt`.
- Created revision.
- Added an inline near the bottom.
- Removed most of `long.txt`.
- Updated revsion.
- Replied to the ghost inline.
- Edited the reply to the ghost inline, worked.
- Hovered the reply to the ghost inline: no line highlight, but no errors.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11662

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

+21 -10
+6 -6
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '0f87a6eb', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => 'ea471cb0', 16 - 'differential.pkg.js' => '58457c19', 16 + 'differential.pkg.js' => '4a466790', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 391 391 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 392 392 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 393 393 'rsrc/js/application/diff/DiffChangeset.js' => '68758d99', 394 - 'rsrc/js/application/diff/DiffChangesetList.js' => '204e4bfc', 394 + 'rsrc/js/application/diff/DiffChangesetList.js' => '796922e0', 395 395 'rsrc/js/application/diff/DiffInline.js' => '1afe9760', 396 396 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 397 397 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', ··· 778 778 'phabricator-darkmessage' => 'c48cccdd', 779 779 'phabricator-dashboard-css' => 'fe5b1869', 780 780 'phabricator-diff-changeset' => '68758d99', 781 - 'phabricator-diff-changeset-list' => '204e4bfc', 781 + 'phabricator-diff-changeset-list' => '796922e0', 782 782 'phabricator-diff-inline' => '1afe9760', 783 783 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 784 784 'phabricator-draggable-list' => 'bea6e7f4', ··· 1066 1066 'javelin-install', 1067 1067 'javelin-dom', 1068 1068 ), 1069 - '204e4bfc' => array( 1070 - 'javelin-install', 1071 - ), 1072 1069 '21df4ff5' => array( 1073 1070 'javelin-install', 1074 1071 'javelin-workboard-card', ··· 1495 1492 '7927a7d3' => array( 1496 1493 'javelin-behavior', 1497 1494 'javelin-quicksand', 1495 + ), 1496 + '796922e0' => array( 1497 + 'javelin-install', 1498 1498 ), 1499 1499 '7a68dda3' => array( 1500 1500 'owners-path-editor',
+15 -4
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 968 968 var number = inline.getLineNumber(); 969 969 var length = inline.getLineLength(); 970 970 971 - var origin = JX.$(prefix + number); 972 - var target = JX.$(prefix + (number + length)); 971 + try { 972 + var origin = JX.$(prefix + number); 973 + var target = JX.$(prefix + (number + length)); 974 + 975 + this._hoverOrigin = origin; 976 + this._hoverTarget = target; 977 + } catch (error) { 978 + // There may not be any nodes present in the document. A case where 979 + // this occurs is when you reply to a ghost inline which was made 980 + // on lines near the bottom of "long.txt" in an earlier diff, and 981 + // the file was later shortened so those lines no longer exist. For 982 + // more details, see T11662. 973 983 974 - this._hoverOrigin = origin; 975 - this._hoverTarget = target; 984 + this._hoverOrigin = null; 985 + this._hoverTarget = null; 986 + } 976 987 } else { 977 988 this._hoverOrigin = null; 978 989 this._hoverTarget = null;