autosuggest fails on null values
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- frontend
調査の方向性
suggestions.js の replaceDiacritics と populateSuggestionsList から始め、dataFields に null 値を含む DataSearch に入力してクラッシュを再現します。null の候補がどのようにダイアクリティカルマークの置換まで到達するかを確認し、既存のマッチング動作を維持したまま autosuggest がクラッシュしないように必要な処理を定義します。
索引モデルが issue の本文から書いたものです。
説明
We are utilizing reactivesearch to query some Elastic data. We are utilizing the showMissing prop option on several filters that are using MultiList. Our understanding is that missing/null data is necessary for showMissing to function and this is all working.
There is also a DataSearch. Today, I was asked to connect the DataSearch to more dataFields and some of those fields are null for some records. For the showMissing to function, I can't (as far as I know) avoid having these null values. When I added the additional fields to the DataSearch's dataFields, the app would crash as soon as I typed anything into the input.
Stack trace showed it was crashing at the str.replace in replaceDiacritics (in suggestions.js) because str had a value of null:
function replaceDiacritics(s) {
let str = s ? String(s) : s;
const diacritics = [
/[\300-\306]/g, /[\340-\346]/g, // A, a
/[\310-\313]/g, /[\350-\353]/g, // E, e
/[\314-\317]/g, /[\354-\357]/g, // I, i
/[\322-\330]/g, /[\362-\370]/g, // O, o
/[\331-\334]/g, /[\371-\374]/g, // U, u
/[\321]/g, /[\361]/g, // N, n
/[\307]/g, /[\347]/g, // C, c
];
const chars = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'N', 'n', 'C', 'c'];
for (let i = 0; i < diacritics.length; i += 1) {
str = str.replace(diacritics[i], chars[i]); // crash here
}
return str;
}
I won't say this is the best fix, but I put a band-aid on the issue by changing
const populateSuggestionsList = (val, parsedSource, source) => {
// check if the suggestion includes the current value
// and not already included in other suggestions
const isWordMatch = skipWordMatch || currentValue
.....
into
const populateSuggestionsList = (val, parsedSource, source) => {
// check if the suggestion includes the current value
// and not already included in other suggestions
val = val ? val : ''; // new
const isWordMatch = skipWordMatch || currentValue
.....
There may be reasons I'm not aware of that you wouldn't want to support the possibility of autosuggest encountering null values, but I thought I would open the issue to inquire if this was the intended behavior.
- 主要言語
- JavaScript
- スター
- 33
- フォーク
- 27
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
appbaseio/reactivecore のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
appbaseio/reactivecore#52 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
appbaseio/reactivecore#47 · リアクション 2 件 ·
-
Allow customization of GraphQL fetch再び着手できるかも @lakhansamani が 2179 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
appbaseio/reactivecore#42 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
appbaseio/reactivecore#29 · コメント 4 件 ·
-
Deprecated aggregation order key [_term] used, replaced by [_key]再び着手できるかも @metagrover が 2908 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
appbaseio/reactivecore#19 · コメント 2 件 · 担当者 1 名 ·
appbaseio/reactivecore の issue をすべて見る
似ている issue
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callオープンeffort:low model:light plan planner:opus-5-5 tests
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
Bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mozilla-mobile/firefox-ios#35986 ·
メンテナーはふだん 1 日以内に返信
-
component:sight
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
agentic-os-org/ANOLISA#6738 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
mastra-ai/mastra#26470 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
feature/cohorts feature/feature-flags team/feature-flags
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信