@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 incorrect normalization in typeahead result matching

Summary: Ref T4441. In D8250 I added code to drop results if they don't match
the current typeahead state, but with the OnDemand source we were incorrectly
comparing normalized values to denormalized values. Instead, pass and compare
raw values.

Auditors: btrahan, chad

+19 -15
+10 -10
resources/celerity/map.php
··· 14 14 'differential.pkg.js' => '322ea941', 15 15 'diffusion.pkg.css' => '3783278d', 16 16 'diffusion.pkg.js' => '7b51e80a', 17 - 'javelin.pkg.js' => 'b771965e', 17 + 'javelin.pkg.js' => '70ecd3ac', 18 18 'maniphest.pkg.css' => 'f1887d71', 19 19 'maniphest.pkg.js' => '1e8f11af', 20 20 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', ··· 211 211 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'c54eeefb', 212 212 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '5f850b5c', 213 213 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '0136cec1', 214 - 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '7383383f', 214 + 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '89889fe7', 215 215 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => 'e9b95df3', 216 216 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js' => '62e18640', 217 217 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadStaticSource.js' => 'c2b8bf64', ··· 644 644 'javelin-typeahead' => 'c54eeefb', 645 645 'javelin-typeahead-composite-source' => '0136cec1', 646 646 'javelin-typeahead-normalizer' => '5f850b5c', 647 - 'javelin-typeahead-ondemand-source' => '7383383f', 647 + 'javelin-typeahead-ondemand-source' => '89889fe7', 648 648 'javelin-typeahead-preloaded-source' => 'e9b95df3', 649 649 'javelin-typeahead-source' => '62e18640', 650 650 'javelin-typeahead-static-source' => 'c2b8bf64', ··· 1245 1245 0 => 'javelin-behavior', 1246 1246 1 => 'javelin-dom', 1247 1247 ), 1248 - '7383383f' => 1249 - array( 1250 - 0 => 'javelin-install', 1251 - 1 => 'javelin-util', 1252 - 2 => 'javelin-request', 1253 - 3 => 'javelin-typeahead-source', 1254 - ), 1255 1248 '75e50c72' => 1256 1249 array( 1257 1250 0 => 'javelin-behavior', ··· 1365 1358 5 => 'javelin-behavior-device', 1366 1359 6 => 'javelin-history', 1367 1360 7 => 'javelin-vector', 1361 + ), 1362 + '89889fe7' => 1363 + array( 1364 + 0 => 'javelin-install', 1365 + 1 => 'javelin-util', 1366 + 2 => 'javelin-request', 1367 + 3 => 'javelin-typeahead-source', 1368 1368 ), 1369 1369 '8a3ed18b' => 1370 1370 array(
+9 -5
webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js
··· 46 46 var value = this.normalize(raw_value); 47 47 48 48 if (this.haveData[value]) { 49 - this.matchResults(value); 49 + this.matchResults(raw_value); 50 50 } else { 51 51 // If we have data for any prefix of the query, send those results 52 52 // back immediately. This allows "alinc" -> "alinco" to show partial ··· 56 56 for (var ii = value.length - 1; ii > 0; ii--) { 57 57 var substr = value.substring(0, ii); 58 58 if (this.haveData[substr]) { 59 - this.matchResults(value, false); 59 + this.matchResults(raw_value, true); 60 60 break; 61 61 } 62 62 } ··· 75 75 } 76 76 var r = new JX.Request( 77 77 this.uri, 78 - JX.bind(this, this.ondata, this.lastChange, value)); 78 + JX.bind(this, this.ondata, this.lastChange, raw_value)); 79 79 r.setMethod('GET'); 80 80 r.setData(JX.copy(this.getAuxiliaryData(), {q : value, raw: raw_value})); 81 81 r.send(); 82 82 }, 83 83 84 - ondata : function(when, value, results) { 84 + ondata : function(when, raw_value, results) { 85 85 if (results) { 86 86 for (var ii = 0; ii < results.length; ii++) { 87 87 this.addResult(results[ii]); 88 88 } 89 89 } 90 + 91 + var value = this.normalize(raw_value); 90 92 this.haveData[value] = true; 93 + 91 94 if (when != this.lastChange) { 92 95 return; 93 96 } 94 - this.matchResults(value); 97 + 98 + this.matchResults(raw_value); 95 99 } 96 100 } 97 101 });