Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/UI bug #576

Merged
merged 7 commits into from Oct 15, 2022
Merged

Hotfix/UI bug #576

merged 7 commits into from Oct 15, 2022

Conversation

hayato24s
Copy link
Contributor

@hayato24s hayato24s commented Oct 1, 2022

以下の手順でcommitをしました。

  1. revertのrevertをしてクリーンアーキテクチャを導入の状態に戻す
  2. バグの修正

修正したバグは以下の2点です。

  • 授業を検索した時に表示される授業の科目番号がuuidになっている
  • 授業詳細画面に遷移するとbtnRef is not definedとエラーが発生する

@hayato24s
Copy link
Contributor Author

vite だとエラーは発生しないのですが、
vite build and vite preview だとエラーが発生する場合があるようです。

ですので、今後デバッグするときはyarn devではなく、yarn previewを用いたようが良さそうです。

@HosokawaR
Copy link
Member

この問題 は再現しませんでしたか?

@HosokawaR
Copy link
Member

HosokawaR commented Oct 1, 2022

Type Check でこれが防げ寝なかったのもきになりますね
↑個人的にここらへんは気になるので調べておきます

追記:
後述するようにバグの可能性があります

@hayato24s
Copy link
Contributor Author

この問題 は再現しませんでしたか?

再現できなかったですね。

@HosokawaR
Copy link
Member

HosokawaR commented Oct 1, 2022

<setup script>を採用し、ref を使用しているページにバグがある可能性があるので、注意してください。

過去の vue/core<setup script> & ref の組み合わせでおかしくなるバグが散見されます。
例)vuejs/core#4431

そして今使っている vue のバージョンは低いので、これに該当する可能性があります。

またそもそも当時は <script setup> は β 版だったような気もしなくもない(調べていないが)ので注意が必要かもしれません。


if (module === "Unknown" || day === "Unknown") return;
if (isSpecialDay(day)) {
specialTimetable[module][day] = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

僕のタグページが落ちる原因がわかりました。
僕の場合ここの module"Annual" が入ってくるので以下のようにタイプエラーになります。

TypeError: Cannot set properties of undefined (setting 'AnyTime')
    at schedule.ts:55:32
    at Array.forEach (<anonymous>)
    at uE (schedule.ts:49:16)
    at dE (registeredCourse.ts:18:32)
    at Array.map (<anonymous>)
    at CourseRepository.ts:207:50
    at GS.call (index.ts:97:16)
    at async mR (course.ts:46:9)
    at async Promise.all (index 1)
    at async hR (course.ts:40:30)

Copy link
Member

@HosokawaR HosokawaR Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ただ open spec を見る限り、module"Annnual" は廃止され、新たにisAnnualみたいなプロパティが付与されていた気がします。
なのでこの問題はフロントよりもバックエンドの問題かもしれませんね…
ただ僕と同じような人はみんなこのページが落ちそうなので、フロントで対処療法的に対応するか、バックエンドに修正して貰う必要がありそうです

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +85 to +100
const {
body,
originalResponse,
status,
}: ApiRespoinse<AR, SS | FS> = await api(this.#client);

if (isContained(status, successStatusList)) {
return callback(body);
}

if (isContained(status, failedStatusList)) {
return this.#handleApiFailedStatus(status, originalResponse);
}

return new InternalServerError(`Invalid Status : ${status}`);
} catch {
Copy link
Member

@HosokawaR HosokawaR Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この PR は HotFix なので、これは今対応しなくてもいい問題だと思います。ただ忘れないように書き残します。

ここでの throw を NetworkError とまとめてしまうのはユーザにとっても開発者にとっても不都合かなと思いました。

なぜならここの部分は NetworkError ではない可能性があるためです。
今回の場合 await api(this.#client); では Type Error が発生していました。しかし例外時に NetworkError() としていることで、ネットワークエラーのえらーメッセージが表示されています

その結果、ユーザにとってはネットワークエラーではないのにネットワークエラーと表示され混乱を与えます。
開発者にとってもネットワークエラーという誤ったエラー報告を受けることでバグの特定が遅れます。

個人的にはもっと通信に関わる部分のみで try {} catch {} したさがあります。

具体的には await api(this.#client); の部分のみですかね…

@HosokawaR
Copy link
Member

HosokawaR commented Oct 2, 2022

授業を削除できないバグもありました
再現手順を後ほど送ります
取り急ぎ

後述するように自分の環境の問題の可能性が高いので無視してよさそう

@HosokawaR
Copy link
Member

HosokawaR commented Oct 3, 2022

なぜか DELETE が CORS で弾かれていました…
Readme に書いてある拡張機能で防いでいるはずなのになぜ
とりあえず僕の環境の問題そうなので一旦スルーで大丈夫です
お騒がせしました…

image

Copy link
Member

@takonasu takonasu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

授業を検索した時に表示される授業の科目番号がuuidになっている
授業詳細画面に遷移するとbtnRef is not definedとエラーが発生する

以上の問題修正されていること確認しました、ありがとうございます!

@takonasu
Copy link
Member

takonasu commented Oct 7, 2022

#576 (comment)
この問題が未解決?

@HosokawaR
Copy link
Member

#576 (comment) この問題が未解決?

そうだと思います。
(このコメントにこの PR を急かす意図はないです。)

@hayato24s
Copy link
Contributor Author

@HosokawaR

Annualの件修正したので、確認してもらえると助かります。

@HosokawaR HosokawaR self-requested a review October 15, 2022 10:30
Copy link
Member

@HosokawaR HosokawaR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!!

単位数ページでバグが発生しないことを確認できました!

@hayato24s hayato24s merged commit b824743 into main Oct 15, 2022
@hayato24s hayato24s deleted the hotfix/ui-bug branch October 15, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants