Implem / Implem.Pleasanter

Pleasanter is a no-code/low-code development platform that runs on .NET. You can quickly create business applications with simple operations.
https://pleasanter.org
GNU Affero General Public License v3.0
511 stars 81 forks source link

サイト統合した一覧から、一括移動させるとデータが見えなくなる(更新データに不整合が発生) #402

Closed mitsugeek closed 1 year ago

mitsugeek commented 1 year ago

【登場人物】

サイトA、サイトB

サイトC(サイトAとサイトBの統合)

【操作手順】 サイトCの一覧から、サイトBのレコードをサイトAに一括移動させる

【結果】 データが見えなくなります。

【詳細】

IssuesテーブルのSiteIdは移動後の値になっている ItemsテーブルのSiteIdは移動前のまま


データ修復のために、データベースを直接操作する必要があるため、 サイト統合表示の一覧では、一括移動機能を使えないようにして対応しております。


統合サイトのサイトIDでItemsを更新してる気がします。

恐らく下記部分のロジックが原因だと思われます。 https://github.com/Implem/Implem.Pleasanter/blob/32bed6ff907793181f0ba21d4b7fe472b4915464/Implem.Pleasanter/Models/Issues/IssueUtilities.cs#L5205

                    Rds.UpdateItems(
                        where: Rds.ItemsWhere()
                            .SiteId(ss.SiteId)   // → ss.SiteId (
                            .ReferenceId_In(sub: sub),
                        param: Rds.ItemsParam()
                            .ReferenceType(guid)),
                    Rds.UpdateIssues(
                        where: where, // → where
                        param: Rds.IssuesParam()
                            .SiteId(siteId)), 
                    Rds.RowCount(),
                    Rds.UpdateItems(
                        where: Rds.ItemsWhere()
                            .SiteId(ss.SiteId)  // → ss.SiteId
                            .ReferenceType(guid),
                        param: Rds.ItemsParam()
                            .SiteId(siteId)
                            .ReferenceType(ss.ReferenceType))
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.