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

Truncate the one-line diff update summary when updating a revision to 250 bytes

Summary:
Fixes T7899. If you create or update a revision and type an enormously long first line, we currently fatal trying to insert it into the database.

This text is only used to show a single-line summary of the diff in the "History" tab, which should probably be updated anyway. For now, stop fataling.

Test Plan:
Uploaded a diff with the description "MMMM..." (thousands of them).

Before patch: fatal on description being too long.
After patch: beautiful "MMMM" summary.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7899

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

+8 -1
+8 -1
src/applications/differential/conduit/DifferentialConduitAPIMethod.php
··· 124 124 $message = $request->getValue('message'); 125 125 if (strlen($message)) { 126 126 // This is a little awkward, and should maybe move inside the transaction 127 - // editor. It largely exists for legacy reasons. 127 + // editor. It largely exists for legacy reasons. See some discussion in 128 + // T7899. 128 129 $first_line = head(phutil_split_lines($message, false)); 130 + 131 + $first_line = id(new PhutilUTF8StringTruncator()) 132 + ->setMaximumBytes(250) 133 + ->setMaximumGlyphs(80) 134 + ->truncateString($first_line); 135 + 129 136 $diff->setDescription($first_line); 130 137 $diff->save(); 131 138