Repository navigation
fix(map): 印刷される一覧の並び順を取得の完了順に依存させない - #562
Closed
yasumorishima wants to merge 1 commit into
Closed
yasumorishima wants to merge 1 commit into
yasumorishima wants to merge 1 commit into
Conversation
layers に取得できた順で push していたため、回線の速さで並びが変わっていた。 一覧の番号は layers を順に辿って振られるので、同じ地点に開くたび違う番号が 付く。紙は刷り直しても配り直せないので、番号で場所を伝えられなくなる。 mounted の頭で mapConfig.sources の順序どおりに layers の位置を確保し、 取得が終わったソースをその位置へ入れる。取れたものから順に地図へ出る挙動は 変えていないので、細い回線でも表示の開始は遅くならない。 回帰テストは ky を差し替えて、あとに書いたソースを先に返させる。 マイクロタスクを何段挟むかで完了順を決めているので、実行環境の速さに 左右されない。修正前はこのうち3件が落ちる。 checkedArea の構築も mounted の頭へ移した。こちらは push が最初の await より 前に走るので元から sources の順序で、挙動は変わっていない。テストは整理で 中身が変わっていないことの確認として置いている。 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要 | About
Fix: #561
layersに取得できた順でpushしていたため、回線の速さで並びが変わっていました。印刷される一覧の番号はlayersを順に辿って振られるので、同じ地点に開くたび違う番号が付きます。mounted()の頭でmapConfig.sourcesの順序どおりにlayersの位置を確保し、取得が終わったソースをその位置へ入れる形にしました。Issue に書かれていた「forEachの添字で位置を決める」案です。取れたものから順に地図へ出る挙動は変えていないので、細い回線でも表示の開始は遅くなりません。checkedAreaの構築もmounted()の頭へ移しました。こちらはpushが最初のawaitより前に走るので元からsourcesの順序で、挙動は変わっていません(不具合ではなく整理です)。動作確認方法 | How to check
test-unit/components/PrintableMap.layerOrder.spec.jsを追加しました。kyを差し替えて、あとに書いたソースを先に返させます。完了順はマイクロタスクを何段挟むかで決めているので、実行環境の速さに左右されません。固定している内容です。
fast→slowでもlayersはslow→fastinBoundsMarkersの並びがsourcesの順序修正を外すと 4 件中 3 件が落ちます(
checkedAreaの 1 件は元から壊れていないので通ります。その旨をテスト内にコメントしてあります)。手元の結果です。
yarn test:unit— 7 suites / 39 tests passedyarn lint— 0 errors(既存の warning 26 件のみ)スクリーンショット | Screenshot
なし(見た目は変わりません)。
base について
テストが #558 で入る
jest.setup.jsとモックを使うため、yuiseki-add-tests-2026-07を base にしています。#558 が master に入ったあとであれば master へ付け替えていただいて問題ありません。