Skip to content

Instantly share code, notes, and snippets.

@takada-at
Created June 7, 2017 03:49
Show Gist options
  • Save takada-at/71e76f19d846b64276f9386f66e0bcd3 to your computer and use it in GitHub Desktop.
Save takada-at/71e76f19d846b64276f9386f66e0bcd3 to your computer and use it in GitHub Desktop.

https://github.jp.klab.com/studio-management/boomerang/pull/325

二回目のアップロードの処理改善のメモ。

上のPRに関して、認識している問題。

  1. アップロードしたExcelをダウンロードすると、色づけがおかしい。すべて「追加」になっている。
  2. 削除されたシートが表示されない。差分表示としては、削除されたシートも含めるのが正解。
  3. ダウンロード時にファイルが壊れて開けないことがある。

再現

以下のエクセル使用 https://drive.google.com/drive/u/1/folders/0ByHImRujLTZ-VUJ1d1ZDaGxBZlE

①1回目のファイルアップロード (【正常系】初回アップード.xslx)
②2回目のファイルアップロード  (【正常系】翻訳デ追加ファイル.xlsx)
③3回目のファイルアップロード (【正常系】シート削除確認.xlsx)

②をダウンロードしてから③をダウンロード
→ 保留中のステータスの行が全て追加扱いになる

③をダウンロードしてから②をダウンロード
ローカライズ権限
・保留中のステータスが消える
・それ以外のステータスが削除扱いになって灰色になる

案件権限
 → ファイルが開けない 
 
①をダウンロード
 → ローカライズ権限と案件権限の両方でDLしてもファイルが壊れてて開けない

原因?

正しいパターン

mysql> select file_info_id, string_id, before_status, after_status, delete_flag from file_change_history_phrase where file_info_id = 152 order by string_id; 
+--------------+------------+---------------+--------------+-------------+
| file_info_id | string_id  | before_status | after_status | delete_flag |
+--------------+------------+---------------+--------------+-------------+
|          152 | a_main0002 |          NULL |            0 |           0 |
|          152 | a_test0001 |             5 |            5 |           0 |
|          152 | a_test0002 |             0 |            0 |           0 |
|          152 | a_test0003 |             0 |            6 |           0 |
|          152 | a_test0004 |             0 |            0 |           0 |
|          152 | a_test0005 |          NULL |            0 |           0 |
|          152 | test       |          NULL |            0 |           0 |
|          152 | test       |             0 |            6 |           0 |
+--------------+------------+---------------+--------------+-------------+

上記PR

mysql> select file_info_id, string_id, before_status, after_status, delete_flag from file_change_history_phrase where file_info_id = 155 order by string_id;
+--------------+------------+---------------+--------------+-------------+
| file_info_id | string_id  | before_status | after_status | delete_flag |
+--------------+------------+---------------+--------------+-------------+
|          155 | a_main0001 |             0 |            0 |           0 |
|          155 | a_main0002 |             0 |            0 |           0 |
|          155 | a_test0001 |             5 |            5 |           0 |
|          155 | a_test0002 |             0 |            0 |           0 |
|          155 | a_test0003 |             0 |            6 |           0 |
|          155 | a_test0004 |             0 |            0 |           0 |
|          155 | a_test0005 |             0 |            0 |           0 |
|          155 | test       |             0 |            0 |           0 |
|          155 | test       |             0 |            6 |           0 |
+--------------+------------+---------------+--------------+-------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment