-
Notifications
You must be signed in to change notification settings - Fork 113
[iOS] 接触日付が9時間ずれて表示される #64
Comments
接触時間が9時間早いものになる(日付が過去のものになる)と言う理解でいいですか? そうだとするとこの現象で起こりうるユーザーの不利益は、
がありますね。 |
まず、Json.NET の DateTimeZoneHandling のデフォルトは そして、すでに Local な DateTime に対して ですので問題はないように思えます(確認はして欲しいです)が、修正はしておいたほうが良いとは思います。 個人的には、日時は UTC (か UNIX秒) で持って欲しいと思っています。 |
再現コードを書いてみたんですが、@tmurakami さんのご指摘の通り ToLocalTime を二重にかけても問題無い様に見えました。 それとは別に、同じく DateTime なら UTC で持って欲しいのと、上流ですでに変更されている為 #1 は取り込んだ方が良いと考えます。 |
私が確認せずに余計なこと言ったのですみませんでした |
余計なことではまったくないと思います。ユーザーが不利益を被る可能性が指摘されて、ひとまず直近で問題なさそうと言うことが明らかになるのは、とても有益なことです。 日付の持ち方を考えなければいけないのは本当にその通りですね。こちらについては念のためぼくの方で検証してからcloseする流れでいこうと思います。 他にもなにかおかしいと思うことがあれば遠慮なくIssueにしてください。 |
検証した結果、 検証コードは次の通りです。
実行結果は次の通りです。
|
close いただいたのですが、#1 の取り扱いをどうするかの話だけ適宜対応お願いします |
不具合の内容 / Describe the bug
COCOA に置いて Xamarin.ExposureNotification は古いバージョンの物をリポジトリ内にコピーして利用しています。
このバージョンでは、ExposureInfo.Timestamp から取得出来る時刻データが、Android では UTC 、iOS では LocalTime であるというバグがあります。
COCOA としてはどちらもUTCとして扱っているようで、iOS 版を日本時間で利用していると日付表示時に9時間ずれて表示される事となります。
表示部分のコード。iOS 版では結果的に ToLocalTime() を二回通すため誤った日付が表示される。
cocoa/Covid19Radar/Covid19Radar/ViewModels/HomePage/ExposuresPageViewModel.cs
Lines 29 to 32 in b823e87
再現手順 / Steps to reproduce
上記の iOS , Android を逆にして実行すると接触した日付が表示される。
期待される挙動 / Expected behavior
Android と同様、接触した日付が表示される。
スクリーンショット / Screenshots
実機でのテストを行う環境が構築できないため、ありません。
動作環境 / Environments
その他 / Additional context
解決策
Xamarin.ExposureNotification のオリジナルにおける修正と、PR #1 は @moonmile 氏による物で修正内容は同一です。
当方で再現環境が用意できないため、エミュレーター・実機による再現テストは行っていません。
念の為、現バージョン(1.2.2)での再現テストを推奨します。
This Issue was written with the help of @zipperpull .
The text was updated successfully, but these errors were encountered: