E2Eテストでワークフロー開始フォームを開くと画面が二重に描画される不具合を修正 - #198
Draft
yacchin1205 wants to merge 1 commit into
Draft
Conversation
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.
Purpose
開発モード(
ember serve/ development ビルド)で起きうる不具合の修正。本番ビルドでは Ember の assertion が無効なため下記の二重描画は発生しないが、その原因である「node の権限値の上書き」は本番でも起きている。RDM-e2e-test-nb の E2E は ember を開発モードで動かしており、Flowable Forms(example-wizard 実行テスト)が 8/20 以降の ember イメージで失敗し続けていた。失敗時の DOM ではアプリのルートが二重に描画されており、
label:has-text("Project Metadata (single)")が 2 要素にヒットする strict mode violation になっていた。原因は
Files::ManagerのcanEditが@alias('node.userHasAdminPermission')で定義されていること。Ember の alias は書き込み可能なため、呼び出し側(workflow / package の file-selector)が@canEdit={{false}}を渡すと、コンポーネント生成時にnode.userHasAdminPermissionへ false が書き戻される。userHasAdminPermissionは getter のみの computed なので、Ember はこれを plain 値で上書きし(computed-property.overrideの deprecation)、以降その node レコードは管理者権限なしとして扱われる。#187 で node-navbar が
@node.userHasAdminPermissionを参照するようになってからは、同一描画内で先に読まれた値を file-selector が書き換える形になる。開発ビルドでは Ember の autotracking assertion(You attempted to update ... but it had already been used previously in the same computation)に該当し、初回描画が中断されて上記の二重描画になると考えられる。Summary of Changes
Files::ManagerのcanEditを@aliasから@reads(一方向 alias)に変更。@canEditが渡された場合はコンポーネント側のローカル値として保持し、node へ書き戻さないSide Effects
node.userHasAdminPermissionが変化しなくなる(従来は false に上書きされ、証跡管理タブなど管理者権限で表示する UI に影響しうる状態だった)QA Notes
_FILE_SELECTORを含むテンプレート)およびメタデータのパッケージ画面で、ファイル選択 UI が表示・操作できることyacchin1205/rdm-ember-osf-web:fix_files-manager-can-edit-alias)で RDM-e2e-test-nb の E2E を実行し、失敗していた Flowable Forms ジョブが成功することを確認済み: https://github.com/RCOSDP/RDM-e2e-test-nb/actions/runs/33582880064