Page MenuHomePhabricator

Recover inline comments which are "adjusted" off the end of a diff
ClosedPublic

Authored by epriestley on Aug 5 2020, 7:59 PM.
Tags
None
Referenced Files
F17807718: D21435.diff
Fri, Jul 25, 3:14 PM
F17798271: D21435.id.diff
Fri, Jul 25, 3:18 AM
F17795904: D21435.id51006.diff
Fri, Jul 25, 12:35 AM
F17770155: D21435.diff
Wed, Jul 23, 9:19 AM
F17676017: D21435.id51008.diff
Sun, Jul 13, 9:38 AM
F17674862: D21435.id51006.diff
Sun, Jul 13, 7:35 AM
F17661249: D21435.id.diff
Sat, Jul 12, 4:14 PM
F17644704: D21435.diff
Fri, Jul 11, 10:57 PM
Subscribers
None

Details

Summary

See PHI1834. Currently, the inline adjustment engine can sometime "adjust" an inline off the end of a diff. If it does, we lay it out on an invalid display line here and never render it.

Instead, make sure that layout never puts a comment on an invalid line, so the UI is robust against questionable decisions by the adjustment engine: no adjustment should be able to accidentally discard an inline.

Test Plan
  • Created a two diff revision, where Diffs 1 and 2 have "alphabet.txt" with A-Z on one line each. The file is unchanged across diffs; some other file is changed.
  • Added a comment to lines P-Z of Diff 1.
  • Before: comment is adjusted out of range on Diff 2 and not shown in the UI.
  • After: comment is still adjusted out of range internally, but now corrected into the display range and shown.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable